aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/abis_nm.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-28abis_nm_ipaccess_rsl_connect: Log bts and trx nrPau Espin Pedrol1-2/+2
Back-port from osmo-bsc.git 24f2f55132f7230e387aef85612dcd6fc59cebe5. Change-Id: I134a3da3700381043bc93aed300ce4ec263e8698
2018-04-16fix handling of state changes in acc rampingStefan Sperling1-5/+9
Take both the operative and administrative states into account when deciding whether to start ACC ramping, and examine old/new state values to avoid triggering ramping for a no-op state change. This requires a fix to gsm_trx_lock_rf(): This function overwrote the old administrative state of a trx before enqueuing a state change request towards the BTS. The BTS will confirm this request with an ACK, at which time a signal is generated which the ACC ramp code listens to. We must not overwrite the old state value until the signal has been handled, otherwise the signal handler cannot tell what the old state was. Tested with a virtphy setup, nanobts, and osmo-bts. This is a port of osmo-bsc commit cda994edb20d24032d6ab4e916d0e9411671cfc0 Change-Id: I235d2c5fa962f2f338e77d0c11502921b37f4c36 Related: OS#2591
2018-03-22backport support for 3-digit MNC with leading zerosneels/mnc3Neels Hofmeyr1-20/+10
Backport the patches with the following change-ids: osmo-bsc.git: I5b097dbb6329f284e3b4914a744d5c3ad628f715 I8e722103344186fde118b26d8353db95a4581daa I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 I38ac98a4d25159cfd4f686efbfbaf8f00625a6d8 osmo-iuh.git: I29ebcddd45fe3079f8883589a83cc7216a535475 Also apply change of ipac_bcch_info.cgi to struct osmo_cell_global_id in src/ipaccess/network_listen.c, a change that appears to not have been necessary in the new split repositories. Related: OS#3010 Change-Id: Ibf50fd7e1ca5472d0a38fcb87c68227d6de44f42
2017-10-23Make TRX rf locking more visibleMax1-2/+6
* log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Cherry-picked from osmo-bsc be356ed32fbd28dc8d1460371d9e47511b20ac63 Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864
2017-07-10Fix BTS attribute requestsMax1-1/+8
* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 §9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317
2017-06-22Fix BTS features length checkMax1-4/+4
While fixing potentially incorrect memory access, the check for maximum number of supported BTS features was incorrectly adjusted instead of feature vectore length check next to it. Fix this by adjusting checks properly and adding comments to avoid future confusion. The error was introduced in a60bb3dd28ce9e3720f8ee1b262893f3e233e2e6. Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae
2017-06-12OML: fix potential OOB memory accessMax1-2/+2
Use sizeof target BTS feature storage to make sure we always fit into pre-allocated memory. Also use it for log check. Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Fixes: CID 170581
2017-06-09Request and parse BTS feature list via OMLMax1-0/+40
Request features supported by BTS when getting attributes over OML. Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Related: OS#1614
2017-06-09Get TRX attributesMax1-32/+64
Request per-TRX attributes in addition to BTS attributes. Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Related: OS#1614
2017-05-17Get basic BTS attributesMax1-0/+71
Request BTS attributes via OML on connection and parse the response: request/parse incoming response as sw-config. Note: only basic BTS-wide KV attributes wrapped in sw-config are supported for now. Change-Id: I589be51daca0cb9e1f3473b93e910e46b06e23ae Related: OS#1614
2017-05-15Prepare for BTS attribute reporting via OMLMax1-5/+5
* use define for number of attributes instead of magic number * add sub_model to gsm_bts struct * expand number of BTS features * mark attributes parameter to abis_nm_get_attr() as const Change-Id: I7ecb0c4339530d3a8354a2f94b34063dda87e030 Related: OS#1614
2017-05-08Use libosmocore for SW Description parsingMax1-76/+12
Requires libosmocore with Ib63b6b5e83b8914864fc7edd789f8958cdc993cd. Change-Id: Ib94db414e94a2a1f234ac6f1cb346dca1c7a8be3
2017-04-28Save PCU version reported by BTSMax1-13/+9
When BTS reports PCU disconnect - clear it. Change-Id: Idb32c73036413ee912f633604150ee17b611cfa7 Related: OS#1615
2017-04-10gsm_bts: add version and variant detailsMax1-2/+2
* add version string to gsm_bts * add PCU version string to gsm_bts * rename GSM_BTS_TYPE_OSMO_SYSMO -> GSM_BTS_OSMOBTS to avoid confusion between BTS model and variant * add variant enum to gsm_bts_model using enum with variants for each hw vendor of OsmoBTS * show connected PCU version (if available) in vty via 'show bts' This will come in handy when logging details regarding particular BTS reported via OML, see: Related: OS#1614 Change-Id: I6710d53115f34634a7b70969cc05fd5c72ff8ab2
2017-04-08abis: log known ACKs and unknown messagesMax1-1/+18
Log expected ACK messages and unhandled messages to aid in troubleshooting. Change-Id: Id3afaaa76e24f63076ae0e6fd2322e4a7fa29b45 Related: OS#1614
2017-03-23Handle PCU version received via OML alertMax1-30/+90
Explicitly check for and log PCU version received from BTS via OML alert message. Change-Id: I3c88663d4e2887a4038b4c3f1387128295b8934e Related: OS#1614
2017-01-23Improve OML failure reportMax1-6/+14
* clearly separate report parts * use textual representation for failure cause if possible Change-Id: I7a98a77011463021d0edd6ecfab1680e211f7e16 Related: OS#1615
2017-01-23cosmetic: use osmo_strlcpy() everywhereNeels Hofmeyr1-4/+3
Shorten some code and make obvious to the reader that the string copy is done in a safe way. Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
2016-11-26abis_nm: ceck fseek() return code in is_last_line()Harald Welte1-1/+3
Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Fixes: Coverity CID 57643
2016-11-26abis_nm: Fix non-null terminated bufferHarald Welte1-0/+1
Unrealistic case (filename of 4096 bytes) Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Fixes: Coverity CID 57620
2016-11-26abis_nm: Fix possible not-null-terminated bufferHarald Welte1-0/+1
Unrealistic case with file name of 4096 bytes length. Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Fixes: Coverity CID 57619
2016-07-28dyn TS: verify_chan_comb(): handle new dyn TS NM_CHANC_*Neels Hofmeyr1-0/+3
Change-Id: I7ce754a48c7f492e921a4450745383bb8dd7225c
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.
2014-11-10bsc: Fix use-after-free on OML NM messages from the BTSJacob Erlbeck1-4/+6
Currently the sign_link pointer is dereferenced after a call to osmo_signal_dispatch, which can indirectly call e1inp_sign_link_destroy. If that happens, accessing *sign_link is illegal and can lead to a segmentation violation. Since only the bts pointer is needed from sign_link after the call to osmo_signal_dispatch, this patch changes abis_nm_rcvmsg_fom to save that pointer to a local variable earlier. Addresses: <0019> input/ipa.c:250 accept()ed new link from 192.168.1.101 to port 3002 SET ATTR NACK CAUSE=Message cannot be performed <0005> bsc_init.c:52 Got a NACK going to drop the OML links. <001b> bsc_init.c:319 Lost some E1 TEI link: 1 0xb351a830 ================================================================= ==13198== ERROR: AddressSanitizer: heap-use-after-free on address 0xb5d1bc70 at pc 0x80a6e3d bp 0xbfbb33d8 sp 0xbfbb33cc Sponsored-by: On-Waves ehf
2014-04-04oml: Fix compiler warning about aliasingHolger Hans Peter Freyther1-3/+5
Make the fill_fom_hdr return the header and use it throughout. CC abis_nm.o In file included from ../../include/openbsc/debug.h:8:0, from abis_nm.c:38: abis_nm.c: In function ‘abis_nm_opstart’: abis_nm.c:1763:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:23:74: note: in definition of macro ‘DEBUGP’ #define DEBUGP(ss, fmt, args...) logp(ss, __FILE__, __LINE__, 0, fmt, ## args) ^ abis_nm.c:1763:2: note: in expansion of macro ‘abis_nm_debugp_foh’ abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ abis_nm.c:1763:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:23:74: note: in definition of macro ‘DEBUGP’ #define DEBUGP(ss, fmt, args...) logp(ss, __FILE__, __LINE__, 0, fmt, ## args) ^ abis_nm.c:1763:2: note: in expansion of macro ‘abis_nm_debugp_foh’ abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ abis_nm.c:1763:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:23:74: note: in definition of macro ‘DEBUGP’ #define DEBUGP(ss, fmt, args...) logp(ss, __FILE__, __LINE__, 0, fmt, ## args) ^ abis_nm.c:1763:2: note: in expansion of macro ‘abis_nm_debugp_foh’ abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ abis_nm.c:1763:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:23:74: note: in definition of macro ‘DEBUGP’ #define DEBUGP(ss, fmt, args...) logp(ss, __FILE__, __LINE__, 0, fmt, ## args) ^ abis_nm.c:1763:2: note: in expansion of macro ‘abis_nm_debugp_foh’ abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ abis_nm.c:1763:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data); ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:23:74: note: in definition of macro ‘DEBUGP’ #define DEBUGP(ss, fmt, args...) logp(ss, __FILE__, __LINE__, 0, fmt, ## args) ^ abis_nm.c:1763:2: note: in expansion of macro ‘abis_nm_debugp_foh’ abis_nm_debugp_foh(DNM, (struct abis_om_fom_hdr *) oh->data);
2014-04-04abis: Check for failure of ftellHolger Hans Peter Freyther1-0/+5
In case ftell -1 will be returned. Coverity complained that the pos we pass to fseek might be negative. In case the ftell fails we are at the last line for sure. Fixes: Coverity CID 1040721
2014-03-26ctrl/abis: When the max_power_reduction changes, send it to the BTSHolger Hans Peter Freyther1-0/+6
In case the max_power_reduction changes, issue a new Set Radio Carrier Attributes command. OML 12.21 allows to not include the ARFCN list and the semantic I picked/understand is that a partial update is possible. Fixes: SYS#267
2014-01-19TSC: Add new gsm_ts_tsc() function to resolve TSC of TSHarald Welte1-4/+1
We don't want every caller to check for ts->tsc == -1 and then using ts->trx->bts->tsc instead. Rather, introduce a new inline function to retrieve the correct value.
2013-10-08abis: Consistent usage of LOGP/DEBUGP for "RSL CONNECT NACK"Alexander Chemeris1-2/+2
2013-07-03hsl: Remove the support for the HSL bts from OpenBSCHolger Hans Peter Freyther1-4/+0
The support has been implemented for an old model, we were told that newer versions would be made incompatible with OpenBSC. Ther are various warnings in the code and coverity has found some new ones. Just remove the code as we don't know of anyone using this code.
2013-01-08abis: Fix the verification of BCCH/SDCCH8 on TRX != 0 for the BS11Holger Hans Peter Freyther1-1/+1
The SDCCH8 is only allowed on trx 0 if there is no BCCH/SDCCH4 on it.
2012-12-19abis: Activate the newest available installed on the BTSHolger Hans Peter Freyther1-5/+24
Select thew newest software from all available file versions.
2012-12-19abis: Create a routine that can parse all SW Descriptions of a SW ConfigHolger Hans Peter Freyther1-32/+55
Be able to parse the entire SW Config IE. Parse the SW Descruption into a struct provided by the caller.
2012-11-11bts: Really drop the BTS in case of an OML NACKHolger Hans Peter Freyther1-0/+1
The previous code didn't work as expected. The trx and dst pointer are located in an union and in the case of the Abis code the dst is used to point to the signalling link timeslot and not the TRX. The is_ipaccess_bts always returned false because the dst was casted to a trx while it was no trx. This fix was tested with the nack_test/NACKTest.st of the test repo.
2012-10-18libbsc: fix message leaks on several error pathsPablo Neira Ayuso1-5/+9
This patch fixes several leak of msgbs in uncommon error paths. Add break at the end of default to make Holger and Peter happy ;-)
2012-09-17abis_nm: Provide a reason when an invalid channel configuration is usedHolger Hans Peter Freyther1-14/+42
Provide a human readable reason the channel combination is not allowed.
2012-09-17abis_nm: Log an error when the channel combination can not be set.Holger Hans Peter Freyther1-1/+1
2012-09-11misc: Address compiler warning on unused variablesHolger Hans Peter Freyther1-2/+1
abis_nm.c: In function ‘abis_nm_get_attr’: abis_nm.c:1380:11: warning: unused variable ‘cur’ [-Wunused-variable] abis_nm.c: In function ‘ipac_parse_bcch_info’: abis_nm.c:2588:11: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] bts_nokia_site.c:1310:6: warning: variable ‘constructed’ set but not used [-Wunused-but-set-variable] bts_nokia_site.c: At top level: bts_nokia_site.c:1364:12: warning: ‘dump_elements’ defined but not used [-Wunused-function] gsm_04_08.c: In function ‘mm_rx_loc_upd_req’: gsm_04_08.c:521:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] osmo_msc.c: In function ‘msc_ciph_m_compl’: osmo_msc.c:122:7: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] bts_hsl_femtocell.c: In function ‘hslfemto_bootstrap_om’: bts_hsl_femtocell.c:101:11: warning: variable ‘cur’ set but not used [-Wunused-but-set-variable] bts_hsl_femtocell.c: In function ‘hsl_drop_oml’: bts_hsl_femtocell.c:232:21: warning: variable ‘line’ set but not used [-Wunused-but-set-variable] handover_logic.c: In function ‘ho_chan_activ_ack’: handover_logic.c:197:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
2012-08-14abis_nm: Add function abis_nm_get_attr() to get attributes from BTSHarald Welte1-0/+19
2012-07-02BSC: introduce new "sysmobts" BTS modelHarald Welte1-0/+4
so far, osmo-bts/sysmobts used to be entered as "sysmobts" type in the configuration file. However, there are some differences in the protocol/behaviour and we should reflect that by a new BTS plugin (with lots of code reuse from the nanobts driver).
2012-02-03misc: abis_nm.c Use the result of ret.Holger Hans Peter Freyther1-1/+7
Use LOGP(DNM, LOGL_ERROR, ...); for errors in the abis_nm_rx_sw_act_req method. GCC warning: abis_nm.c: In function ‘abis_nm_rx_sw_act_req’: abis_nm.c:412:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
2011-09-26Fix Ericsson RBS2000 support after libosmo-abis mergeHarald Welte1-11/+3
The libosmo-abis merge broke Ericsson RBS support, as it didn't get the part right where the per-TRX OML sign_link is determined while transmitting OM2000 messages. As a result of this fix, we can remove the 'to_trx_oml' parameter to _abis_nm_sendmsg(), which is a nice cleanup.
2011-08-19src: port openBSC over libosmo-abis0.9.15Pablo Neira Ayuso1-2/+22
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
2011-08-19src: use new msg->dst pointer instead of deprecated msg->trxPablo Neira Ayuso1-26/+36
This patch modifies openBSC code to use msg->dst which stores the pointer to the signalling link structure instead of the pointer to the transceiver structure. This patch prepares the introduction of libosmo-abis.
2011-07-16abis_nm: fix signedness error (uint8_t len cannot be negative)Harald Welte1-1/+1
Detected by Smatch
2011-06-06move objclass2{nmstate,mo,}obj() to gsm_data_shared.c (and prefix)Harald Welte1-158/+4
2011-06-03Introduce per-ts TSCHarald Welte1-1/+4
This allows us to configure a TSC for each timeslot, not just one globally for the entire BTS.
2011-06-03gsm_data_shared: introduce 'struct gsm_abis_mo'Harald Welte1-20/+34
... as a common wrapper around nm_attr and nm_state
2011-05-24move some more abis_nm related code into libosmocoreHarald Welte1-19/+0
This syncs openbsc.git with libosmocore.git commit rev 11c7193ad8ceb4f3898799dc44b700b8b93a59b8
2011-05-23abis_nm: Some more fall-out from the abis_nm move to libosmocoreHarald Welte1-1/+2
we want get_string_value(), not the equivalent of get_value_string()