aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/utils
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27move openbsc/* to repos rootNeels Hofmeyr10-2729/+0
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2017-05-20Add missing _CFLAGS and _LIBSAlexander Huemer1-0/+3
These missing pieces go unnoticed if dependencies are not installed in distinct directories. Change-Id: If8d57b72f63d79cc0d8efba7466c6ec177207cbb
2017-05-10src: use osmo_timer_setup()Pablo Neira Ayuso1-1/+1
Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
2017-05-02Make pcap dependency optionalMax1-1/+5
Previously we required pcap.h unconditionally which causes embedded build failure because it's not included in current version of out poky toolchain. We can add it to toolchain but it's only necessary for utils/osmo-meas-pcap2db which is not built for sysmobts anyway so it's easier to just make this dependency optional and build osmo-meas-pcap2db only if it's available - similar to the way we build osmo-meas-udp2db. Related: SYS#3610 Change-Id: I77a5f7eafe0282abedacffad6a9bcb0a8f2b5caa
2017-04-26Fix MS TO measurement representationMax2-3/+2
* set proper flag when saving MS Timing Offset * use gsm_subscriber's IMSI or lchan's name if bsc_subscriber is unknown * add comments with spec reference * store/display MS Timing Offset instead of raw Timing Offset field from RSL * Compute MS Timing Offset [-63; 192] from Timing Offset field [0; 255], adjust structure gsm_meas_rep with proper type to store it Change-Id: I7e003d23a6edb714c5f17688fd6a8edac131161d Related: OS#1574
2017-03-01meas_json: fix NEIGH: missing array bracesKeith1-1/+2
Make NEIGH an array of Javascript objects, otherwise the JSON is not parseable when neighbours exist Change-Id: I42029f40bf357adbb2f3c71cdcbafbc21090e348
2017-02-25utils: 'meas_json' utility to convert measurement feed into a JSON feed.Alexander Chemeris2-0/+206
Change-Id: I56631969384da245eed8ffc14845c76a5d4de8d4
2017-01-23cosmetic: use osmo_strlcpy() everywhereNeels Hofmeyr1-2/+2
Shorten some code and make obvious to the reader that the string copy is done in a safe way. Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr1-0/+1
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-24move to libcommon-cs: net init 2: move bsc_network_init decl to new .hNeels Hofmeyr1-1/+1
bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-24move to libcommon-cs: net init 1: rename to bsc_network_initNeels Hofmeyr1-1/+1
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-11bs11_config: remove compiler waring about unused variableHarald Welte1-2/+2
bs11_config.c:78:22: warning: ‘too_fast’ defined but not used [-Wunused-const-variable=] static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; ^~~~~~~~ Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b
2016-10-13msgb talloc ctx: initialize in all main() scopesNeels Hofmeyr4-0/+7
Add msgb_talloc_ctx_init() call to many main() functions still lacking a msgb talloc context. Change-Id: Ib0d6751260659cabf18a7ce80680ba2fb4228ea1
2016-10-13meas_pcap2db.c: remove unused include of msgb.hNeels Hofmeyr1-1/+0
Change-Id: I2197432c9482537bd5cf06a6c4fc912607ffab53
2016-10-13bs11_config: initialize bs11 tall ctx, use instead of bsc ctxNeels Hofmeyr1-0/+2
Actually initialize tall_bs11cfg_ctx as named const. Change-Id: I3b42b29cd1a688cb4c9d1d4e44208509d936e4ef
2016-09-26mscsplit: gsm_network_init(): add explicit root talloc ctxNeels Hofmeyr1-1/+1
Decouple the root talloc context from libbsc's global talloc_bsc_ctx. This allows to define the root talloc ctx from a main() scope, which in turn helps decouple libmsc from libbsc. Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-18utils/Makefile.am: remove unused LIBOSMOVTY_CFLAGSNeels Hofmeyr1-1/+0
Change-Id: Id1152b105bb7364a06d9720829d39f587242b707
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer1-27/+108
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-07-25bs11_config: add brackets to fix warning in argument parsingAlexander Couzens1-1/+2
Change-Id: I2f02e09a21ca622b03fd966445f533263a499c8d
2016-06-18rm dup: use channel type names from libosmocoreNeels Hofmeyr1-1/+1
In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings from libosmocore instead of redefining the same strings. The list from libosmocore is also more complete, including CCCH and PDTCH. Add a todo comment to move to libosmocore. In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp, mgcp_test, mgcp_transcoding_test and smpp_mirror, smpp_test. Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc
2016-03-15meas: Do not retry to close the databaseHolger Hans Peter Freyther1-11/+2
There is no concurrency involved and if it failed the first time, it will fail the second, third, ... time as well. Simply print that we will leak the database instance.
2016-03-01db: evaluate return value of sqlite3_finalize(), tweak log output.Neels Hofmeyr1-4/+10
2016-02-29check return value of sqlite3_close(), retry up to three times.Neels Hofmeyr1-1/+11
2016-02-29use sqlite3_close() instead of sqlite3_close_v2()Neels Hofmeyr1-1/+1
This allows using sqlite3 v3.7.13, used by our current debian installation in the test setup. _v2 was added in v3.7.14.
2016-02-18Patch to make openbsc find libsmpp34Ruben Undheim1-1/+2
This patch lets the build script for openbsc find the libsmpp34 installation with the help of pkg-config instead of assuming the header files are in /usr/include.
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte1-1/+1
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).
2015-11-20meas_db.c: fix compiler warningsHarald Welte1-0/+1
s_db.c: In function ‘_insert_ud’: meas_db.c:65:6: warning: implicit declaration of function ‘rxlev2dbm’ [-Wimplicit-function-declaration] rxlev2dbm(ud->full.rx_lev))); ^
2015-11-05Fix Warning: openbsc implicit-pointer-decl meas_udp2db.c:50Martin Hauke1-0/+1
2015-11-05Fix no-return-in-nonvoid-function meas_vis.cMartin Hauke1-0/+2
RPM post-build-checks found some issue and marks these as error: [ 38s] I: Program returns random data in a function [ 38s] E: openbsc no-return-in-nonvoid-function meas_vis.c:118
2015-03-28write_queue: Check the result of osmo_wqueue_enqueue and freeHolger Hans Peter Freyther1-1/+7
The write_queue is designed to have a maximum amount of pending messages and will refuse to take new messages when it has been reached. The caller can decide if it wants to flush the queue and add the message again, create a log. But in all cases the ownership of the msgb has not been transferred. Fix the potential memory leak in the failure situation.
2015-01-10meas: Unbreak the build once moreHolger Hans Peter Freyther1-6/+8
The code assumes that sqlite3.h is in the standard include path. Maybe sqlite3 wasn't installed or resides in a non standard (/usr/local) location? Fix the build as it has been broken since 1st of January.
2015-01-05meas_pcap2db.c: Fix build without CDKHarald Welte1-2/+0
Spotted by Jacob Erlbeck.
2015-01-01meas_feed: add osmo-meas-udp2db for realtime feed into databaseHarald Welte2-2/+129
This tool can save the meas_feed messages from UDP port 8888 directly to a sqlite3 database for further analysis.
2015-01-01meas_feed: Add tool to read meas_feed PCAP and write it to sqlite3Harald Welte4-2/+489
In fact, the DB write code has been split out so we could later also have a binary that would listen to realtime meas_feed packets and stuff them into a database without any intermediate PCAP step. The database schema contains a couple of convenience wrapper views, most notably the "overview" view.
2015-01-01build meas_vis only if libcdk is availableHarald Welte1-0/+4
2015-01-01meas_vis: Add header and print TA + TO valuesHarald Welte1-9/+23
2015-01-01meas_vis: assign bar colors depending on level, display RxQualHarald Welte1-4/+53
2015-01-01Initial support for export + curses-visualization of measurementsHarald Welte2-1/+248
This extends osmo_nitb to offer a UDP feed of real-time measurement reports, which can be used by (a variety of) external tools for visualization or other processing. We also add a small ncurses based tool (meas_vis) which shows a baragraph display of the last few mobile stations that were active, indicating their uplink/downlink receive level and quality. <WARNING> This sends non-portable structures like gsm_meas_rep over UDP and assumes the receiver has identical alignment and endianness! Before this feature is merged, it either needs to be converted to a unix domain socket (but they don't do multicast, which would be nice) or the wire format needs to change into something portable with defined alignment and encoding </WARNING>
2015-01-01Fix most compiler warnings with gcc-4.9.2Harald Welte1-2/+4
2014-11-11bsc: Move gsm_subscriber_base.c to libcommonJacob Erlbeck1-2/+2
Since it is planned to use struct gsm_subscriber to manage subscriber data in the SGSN, this file which contains the generic subscriber related methods is moved to libcommon. Sponsored-by: On-Waves ehf
2013-12-12smpp_mirror: Initialize rc when cmd_id is not DELIVER_SMHolger Hans Peter Freyther1-0/+2
Fixes: Coverity CID 1042369
2013-07-27misc: Fix compilation warningsHolger Hans Peter Freyther1-0/+1
bsc_api.c:417:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] bsc_api.c: In function ‘handle_ass_fail’: bsc_api.c:458:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] db.c: In function ‘db_sync_subscriber’: db.c:785:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘time_t’ [-Wformat] osmo_msc.c: In function ‘msc_release_connection’: osmo_msc.c:145:20: warning: unused variable ‘trans’ [-Wunused-variable] smpp_smsc.c: In function ‘link_accept_cb’: smpp_smsc.c:891:24: warning: assignment from incompatible pointer type [enabled by default] smpp_smsc.c:271:1: warning: ‘esme_by_system_id’ defined but not used [-Wunused-function] smpp_openbsc.c: In function ‘smpp_openbsc_init’: smpp_openbsc.c:545:2: warning: implicit declaration of function ‘smpp_vty_init’ [-Wimplicit-function-declaration] osmo_bsc_ctrl.c: In function ‘verify_bts_loc’: osmo_bsc_ctrl.c:340:19: warning: variable ‘height’ set but not used [-Wunused-but-set-variable smpp_mirror.c: In function ‘main’: smpp_mirror.c:297:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2013-07-03isdnsync: Remove a double close of the isdn deviceHolger Hans Peter Freyther1-1/+0
The fd is already closed above the if statement and Coverity detected this as a double close. Fixes: Coverity CID 1040703
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2012-11-24SMPP: add small utility program 'smpp_mirror'Harald Welte2-0/+324
This program binds as ESME transceiver to a SMSC and simply mirrors back all SMS that it receives.
2011-10-16misc: Linking fixes for Ubuntu 11.10 CompilerHolger Hans Peter Freyther1-2/+3
Ubuntu 11.10 has changed some linker/compiler flags. Some fixes for this can be seen here[1]. In general the to be linked libs need to be moved into the LDADD section of parameters. This is with the old BFD linker (not gold). This is likely to end in some ping-pong with other versions of the linker. [1] https://bugs.launchpad.net/ubuntu/+source/nis/+bug/771034 Errors: /usr/bin/ld.bfd.real: bsc_hack.o: undefined reference to symbol 'osmo_init_ignore_signals' /usr/bin/ld.bfd.real: note: 'osmo_init_ignore_signals' is defined in DSO /home/ich/install/openbsc/lib/libosmocore.so so try adding it to the linker command line /home/ich/install/openbsc/lib/libosmocore.so: could not read symbols: Invalid operation ... ../../src/libbsc/libbsc.a(rest_octets.o):/home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:381: more undefined references to `bitvec_set_bit' follow ../../src/libbsc/libbsc.a(rest_octets.o): In function `rest_octets_si13': /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:382: undefined reference to `bitvec_set_uint' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:383: undefined reference to `bitvec_set_uint' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:385: undefined reference to `bitvec_set_bit' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:402: undefined reference to `bitvec_set_bit' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:403: undefined reference to `bitvec_set_uint'
2011-08-19src: port openBSC over libosmo-abisopenbsc/0.9.150.9.15Pablo Neira Ayuso3-263/+53
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-1/+1
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-16bs11_config: fix array bounds problem by using value_stringHarald Welte1-20/+18
Detected by Smatch: /home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +223 linkstate_name(5) error: buffer overflow 'bs11_link_state' 3 <= 3 /home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +240 mbccu_load_name(5) error: buffer overflow 'mbccu_load' 6 <= 6 /home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +905 main(34) info: ignoring unreachable code.
2011-06-05split gsm_data.c in gsm_data_shared.c and gsm_data.cHarald Welte1-2/+2
This facilitates the use of gsm_data.c from osmo-bts