aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs
AgeCommit message (Collapse)AuthorFilesLines
2018-02-20Logger: Remove gLogToConsole flagPau Espin Pedrol2-15/+8
No code is using it and we always lock to console anyways. Change-Id: I5fde99c6af5a845e635b5d27abab855682071f14
2018-02-20Logger: Remove unused includesPau Espin Pedrol1-4/+0
Change-Id: I4d26c0b4f36ee3c66ed1a9e2e9fa2fa8272da16d
2018-02-20Logger: Drop support to log into filePau Espin Pedrol1-19/+1
This feature is currently not being used, so let's simplify current code to move to libosmocore logging system in the future. Change-Id: If2c77c776823f595130edac963be953026049423
2018-02-20Logger: Drop syslog supportPau Espin Pedrol2-39/+12
This feature is currently not being used, so let's drop it to make it easier to integrate into libosmocore logging system in the future. Change-Id: I8282745ef0282d41599eaf94fe460a1d29b18e2a
2018-02-20Logger: get rid of alarm APIsPau Espin Pedrol2-51/+0
It's only used internally inside the Logger module, and in case there's an "alarm" (level more than critical) we still print on cerr, so we can just rely on our system catching stderr instead of stdout to handle it. Change-Id: I6d6df1578c3a4c1a37bd0d69952d443f62eed2ab
2018-02-20Logger: Remove unused logging macrosPau Espin Pedrol1-17/+0
Change-Id: I1133e181183bec8dabe2fa77d0385f783458503f
2018-02-20Logger: Drop unused gLogEarlyPau Espin Pedrol2-35/+0
Change-Id: I2c8f24fbf453e0a94d7a95c3df7cc75f0e4bd456
2018-01-23Remove unneeded libdl dependencyPau Espin Pedrol1-1/+1
Closes: OS#1929 Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd
2018-01-11Remove UDDSocket classPau Espin Pedrol2-67/+0
This class is not used anymore in osmo-trx, so we can safely remove it. Change-Id: I67f90aa3d6a2a5e92292436d10928e0705c8f8ff
2018-01-10Sockets.cpp: Fix initialization of UDD socketPau Espin Pedrol1-0/+1
Without this line, destination address for a UDD socket is left with incorrect value AF_UNSPEC. Later on when calling DatagramSocket:write(), sendto() fails with EINVAL. This commit fixes test SocketsTest.cpp. Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433
2018-01-10Set up GNU Autotest infrastructurePau Espin Pedrol8-529/+0
Test files are moved from CommonLibs/ to tests/CommonLibs/. Some tests are disabled in autotest because they generate timedate related output which cannot exactly match against expected output. Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc
2018-01-09Remove Configuration module and libsqlite dependencyPau Espin Pedrol6-1928/+6
Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa
2018-01-09Drop use of ConfigurationTable gConfigPau Espin Pedrol2-9/+0
After latest changes, it is not being used anymore. Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de
2018-01-09Logger: Stop using Log.File and Log.Level from configPau Espin Pedrol2-93/+17
This is a required step towards getting rid of ConfigurationTable class and libsqlite dependency. As a side effect, support for different log levels for different files is dropped, but it's not something really being used and we will end up dropping current logging system in favour of osmocom's one in the future anyway. Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51
2018-01-09Logger: Stop using Log.Alarms.Max from configPau Espin Pedrol2-13/+2
This is a first step towards removing ConfigurationTable class and sqlite3 dependency. Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a
2018-01-09cosmetic: Remove trailing whitespacePau Espin Pedrol2-6/+1
Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5
2018-01-04Remove unused headersMax1-4/+0
Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989
2017-11-07SocketsTest: Fix printing of non-nul-terminated stringHarald Welte1-1/+2
Change-Id: I33d0ddf851d84b81ab5252e3755422170cee54ee Fixes: Coverity CID#149363
2017-08-16Add -j option to bind to specific addressPau Espin Pedrol3-13/+13
Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec
2017-06-19common: Declare explicit Vector move constructorTom Tsou1-2/+2
Vector class already has a semantically odd non-const copy constructor that serves the same function as a C++11 move constructor. Make the move constructor semantics explicit and address Coverity at the same time. Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Fixes: Coverity CID 170738
2017-06-08PRBS: a Pseudo-random binary sequence (PRBS) generator class.Alexander Chemeris3-0/+156
Implemeted with a Galois LFSR for speed and flexibility compared to Fibonacci version. Aliases for three popular PRBS' are added for convenience - PRBS9, PRBS15 and PRBS64. Note that we can't test PRBS64 completely, because the sequence is too long to be generated. Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74
2017-05-30BitVector: Remove Generator class.Alexander Chemeris2-86/+0
It is not used in osmo-trx, because we're not doing FEC or CRC checks. Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
2017-05-30Configuration: Variables allocated with 'new' must be freed with 'delete'.Alexander Chemeris1-3/+3
Thank you Valgrind. Change-Id: I8477e4e37282947f9841cee9002565631ca0c0b6
2017-04-03Configuration: Fix const and signedness compile warningsTom Tsou2-2/+2
Change-Id: I701559814b2aee6f84f10e612f128da40f6a51c1
2017-03-24vector: Introduce shrink() function to shrink vector size without loosing data.Alexander Chemeris1-0/+7
Change-Id: I9c0ac2715aea1a90c9e6ebcd982522b80a547099
2017-03-24vector: Introduce segmentMove() method to move data inside of a vector.Alexander Chemeris1-0/+15
Change-Id: I2f3f4267b4137a0bc031f27e0f896fba9b9f3433
2017-03-22BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.Alexander Chemeris2-13/+13
This makes code simpler and will allow us send -127..127 soft bits towards osmo-bts instead of 0..255 bits. Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
2017-03-22BitVector: Remove convolutional codec - we don't use it in osmo-trx.Alexander Chemeris3-411/+1
Now we have more fexibility in how we represent SoftVector, since we no longer depend on the particular convolutional codec implementation. Change-Id: I3006b6a26c5eff59dbe9c034f689961802f1d0d0
2017-03-22CommonLibs: Print soft bits with less confidence to console when printing a ↵Alexander Chemeris1-0/+4
soft vector. We use other symbols to show that these bits has less confidence: o and . for 0 with less confidence | and ' for 1 with less confidence Change-Id: I747a17568ee48f1f3163e8dfab2e450af85e6435
2017-03-20CommonLibs: Remove unused files.Alexander Chemeris17-1313/+49
Change-Id: I2bfb45a1c7d01785bdb30204dba38c683a4288a9
2017-01-26Fix building against sqlite3Max2-5/+5
* Explicitly check for sqlite3 at configure stage, remove old include dir, fix header inclusion. * Use configure results for linking instead of hardcoded linker option for sqlite. * Add dependency on -dev package for .deb Change-Id: I6d7f697d67651f02ceb77fc4da4317b64fa47f9e Fixes: OS#1928
2016-05-02common: Add mandatory length field to UDP receive callsTom Tsou3-17/+13
Current UDP receive reads up to MAX_UDP_LENGTH bytes into the passed in buffer, which may lead to buffer overflow if the write buffer is of insufficient size. Add mandatory length argument to UDP socket receive calls. Reported-by: Simone Margaritelli <simone@zimperium.com> Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-05-02common: Restrict UDP binding to localhost onlyTom Tsou1-1/+1
Reported security vulnerability where control and data UDP packets can be injected into the transceiver externally due to socket binding to all interfaces using INADDR_ANY. Existing socket interface does not allow specifying local address; only the local port and remote address/port are arguments. Restrict socket bind to localhost with INADDR_LOOPBACK. If external interfaces do need to be used, the API should be modified to allow specifying the local socket address. Reported-by: Simone Margaritelli <simone@zimperium.com> Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-04-20Common: Make sure gLogEarly() log to the same facilities as the normal log.Alexander Chemeris1-6/+33
2016-04-20Common: Get rid of a compilation warning.Alexander Chemeris1-1/+1
debugLogEarly was replaced to an empty space and arguments of the function became operators, grouped together by (): Configuration.cpp: In member function 'bool ConfigurationTable::defines(const string&)': Configuration.cpp:272:28: warning: left operand of comma operator has no effect [-Wunused-value] debugLogEarly(LOG_ALERT, "configuration parameter %s not found", key.c_str()); ^ This fix removes debugLogEarly together with its arguments.
2015-07-30Logger: Output ERR log messages to stderr as well.Alexander Chemeris1-1/+1
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Common: Use a scoped lock in the Logger to avoid deadlock on thread cancel.Alexander Chemeris1-2/+1
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-24Common: Log to console instead of loging to syslog by default.Alexander Chemeris1-2/+2
2015-05-24Common: Introduce a global variable to disable syslog logging.Alexander Chemeris2-8/+11
When we enable DEBUG logging level, syslog gets Gb's of data and can completely exhaust the file system free space. Now we can just enable it. This is not to say that logging to syslog it just not very useful in general.
2014-12-15CommonLibs: Add thread cancellation capabilityTom Tsou1-1/+8
For clean shutdown in the transceiver we need to cancel and join running threads for orderly unwinding. Thread cancellation points already exist, so we just need to be able to call on the threads to exit out when stopping or shutting down. Don't error when joining a NULL thread, which would be the case if a thread was stopped before ever being started to begin with. Signed-off-by: Tom Tsou <tom@tsou.cc>
2013-05-31syncing commonlibs with Many thanks to Michael Iedema for these patches, ↵kurtis.heimerl25-215/+2034
makes config a lot better. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-02-15Synced sqlite3utils with private and fixed a small recursive bug in ↵kurtis.heimerl1-8/+15
SIPEngine that was already fixed in private git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4912 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-22Correction of trivial warnings.kurtis.heimerl2-2/+2
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4670 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-17From b453f10d65dd1ff1df0dd3747adf63f4e1fd7d30 Mon Sep 17 00:00:00 2001kurtis.heimerl1-11/+34
From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Date: Sun, 16 Dec 2012 17:44:10 +0400 Subject: [PATCH] Use gethostbyname2_r() instead of gethostbyname() if available. gethostbyname() is not thread-safe. It's recommended to use gethostbyname_r() or gethostbyname2_r() instead. --- CommonLibs/Sockets.cpp | 44 +++++++++++++++++++++++++++++++++----------- configure.ac | 4 ++++ 2 files changed, 37 insertions(+), 11 deletions(-) git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4637 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-17From 32bbfc3c89b1c56672bf2fd3660a45c513ac54d4 Mon Sep 17 00:00:00 2001kurtis.heimerl1-2/+2
From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Date: Sun, 16 Dec 2012 17:33:46 +0400 Subject: [PATCH 1/4] Fix typos in comments. --- CommonLibs/Logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4635 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-16OH GOOD GIT MISSED THESE FILES THANKS GITkurtis.heimerl2-0/+231
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4630 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-16Sylvain patch #2, with modifications:kurtis.heimerl5-17/+25
CommonLibs: Avoid direct syslog calls in ConfigurationTable We instead introduce a 'log early' facility in Logger.h to accomplish the same Signed-off-by: Sylvain Munaut <tnt@246tNt.com> I added similar code to the reporting functions, which did not exist when sylvain made this patch git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4629 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-16Patch 4545 in private:kurtis.heimerl2-3/+12
Added support for performance-reporting counters. and Patch 4588 in private: For some reason, ReportingTest won't build on all systems. Since it is not part of the actuall application, I am commenting it out from the Makefile.am for now. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4627 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-11-23missed something in one of the socket patches. now works as expectedkurtis.heimerl1-0/+1
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4516 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-11-23r4425 in private:kurtis.heimerl1-1/+2
Double check the FD set to be sure that the correct FD was really touched. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4513 19bc5d8c-e614-43d4-8b26-e1612bc8e597