aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/abis_nm.c
AgeCommit message (Collapse)AuthorFilesLines
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()
2011-05-23abis_nm: fix some fallout regarding abis_nm migration to libosmocoreHarald Welte1-1/+1
Thanks to Holger for noticing this.
2011-05-22abis_nm: Move lots of generic definitions + code to libosmocoreHarald Welte1-388/+26
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso1-2/+2
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-06src: use namespace prefix osmo_signal*Pablo Neira Ayuso1-10/+10
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-04-26abis: Use LOGL_ERROR for the Failure Event ReportHolger Hans Peter Freyther1-6/+6
It is not an error of the BSC but we will treat a BTS error like an error of the BSC for now.
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther1-1/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-148/+148
This was done with sed on the files.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-3/+3
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-06OML: Include a pointer to the BTS in NM STATE CHANGE signalsHarald Welte1-0/+2
... this allows the BTS driver to decide if it should handle the event at all
2011-03-06OM2000: Track the Operational Info and MO stateHarald Welte1-0/+2
2011-03-04[HSL] initial support for the HSL 2.75G FemtocellHarald Welte1-0/+6
The HSL Femtocell seems to be a poor man implementation of the ip.access Abis/IP protocol, but cutting corners wherever possible. We try to workaround those corners wherever possible...
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-0/+3126
... and make sure tests work again after restructuring