aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-04-07bssgp: Always expect dup != NULL in bssgp_tx_dl_ud (Coverity)Jacob Erlbeck1-25/+24
Currently the implementation of bssgp_tx_dl_ud conditionally adds some optional IE if dup != NULL. Later on is dereferences dup to access qos_profile and fc, but this without checking dup in advance. This may lead to an segmentation violation fault. This commit changes the value range of the function to only accept dup != NULL. An assertion will fail otherwise. All other explicit checks for non-NULL are removed. Fixes: Coverity CID 1040673 Sponsored-by: On-Waves ehf
2015-04-05ctrl: Avoid accessing cmd_desc->command out of boundsHolger Hans Peter Freyther1-1/+1
We check that the amount of commands is not more than we have but we don't check it the other way. It appears that the vector is allowed to be bigger than the amount of commands. So we match a prefix of a longer command depending on the installation order.
2015-03-28gsm: Add A5/3-4 cipher supportMax1-3/+68
Signed-off-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-03-20vty: Fix writing the logging of categoryMichael McTernan1-1/+1
Fix copy and paste issue introduced by Holger in 2d6ad13d8daf860595e6d4025861e122ce574871.
2015-03-18libctrl: Include config.h so we can include netinet/tcp.hHolger Hans Peter Freyther1-0/+2
In e15ac060e7ae78d4c3569d7fc9071bcf49807e05 we tried to fix the nuttx build but we never included "netinet/tcp.h" after it and the compiler warned about the unused "on" parameter which we didn't notice because of the other warnings... Include config.h so we can see if there is a tcp.h and then include it.
2015-03-18msgfile: Fix warning on BSDs stdioHolger Hans Peter Freyther1-0/+2
msgfile.c:116:16: warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration] while (getline(&line, &n, file) != -1) {
2015-03-18gsm0808: Remove duplicate initializationHolger Hans Peter Freyther1-1/+0
These types were compatible so simply remove one. Fixes: gsm0808.c:323:37: warning: initializer overrides prior initialization CC gsm0480.lo of this subobject CC abis_nm.lo [-Winitializer-overrides] [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:316:36: note: previous initialization is here [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~
2015-03-18bssgp: Handle BSSGP STATUS messagesJacob Erlbeck1-16/+62
Currently incoming BSSGP STATUS messages are just logged and no other action is taken. This makes it impossible for higher layers to react to failures which are indicated by corresponding STATUS messages unless a timeout is triggered as a result of that failure later on. This commit adds a bssgp_rx_status() function and calls it on incoming STATUS messages. That function logs a message, increments the new BSSGP_CTR_STATUS counter if the bctx context exists and invokes an NM_STATUS status indication. The latter will allow the application to handle failures immediately. Since all STATUS messages should be handled, the function is already called in bssgp_rcvmsg and the message is no longer handled in (and will not reach) bssgp_rx_sign and bssgp_rx_ptp. Ticket: OW#1414 Sponsored-by: On-Waves ehf
2015-03-18bssgp: Don't reply with STATUS when receiving a PtP STATUS messageJacob Erlbeck1-0/+2
Currently each incoming PtP BSSGP STATUS message is handled as 'not yet implemented' and a BSSGP STATUS message (cause BSSGP_CAUSE_PROTO_ERR_UNSPEC) is sent back to the peer. This will cause endless messages loops if both peers use this BSSGP stack implementation. This does not apply to signalling messages. This commit changes the implementation of bssgp_rx_ptp() to just do logging in this case. Sponsored-by: On-Waves ehf
2015-03-18logging: Implement subsecond resolution of extended timestampsJacob Erlbeck1-4/+7
Currently when using 'logging print extended-timestamp 1', the subsecond part (milliseconds) of the printed timestamp is always 0. This makes it difficult to correlate log entries with PCAP file entries if there are many of them per second. This patch changes _output in logging.c to use gettimeofday() instead of time() when extended timestamps are enabled and replaces the '000' by the milliseconds computed from tv_usec. Sponsored-by: On-Waves ehf
2015-01-27vty: Fix typo in the state creationHolger Hans Peter Freyther1-1/+1
This got introduced in 2d6ad13d8daf860595e6d4025861e122ce574871 and I thought that our vty tests would have caught such mistakes.
2015-01-18Prepare a new libosmocore release0.8.0Holger Hans Peter Freyther2-2/+2
2015-01-18ctrl: Link to libraries we use symbols fromHolger Hans Peter Freyther1-1/+4
Fixes: dpkg-shlibdeps: warning: symbol vector_free used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set_index used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol tall_vty_vec_ctx used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol ipa_msg_recv_buffered used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_free_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup_ensure used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_make_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_init used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries
2015-01-18sim: Link to libosmocore and libosmogsmHolger Hans Peter Freyther1-2/+5
The big LIBOSMOCORE_CFLAGS and LIBOSMOCORE_LIBS macros are not defined when building linosmocore. Use the .la files directly Fixes: dpkg-shlibdeps: warning: symbol osmo_hexdump used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol gsm48_parse_ra used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_zero used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_memdup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strndup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_length used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_alloc used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_free used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strdup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_free used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries
2015-01-01Supplementary Services (de)activation, interrogation addedTobias Engel2-25/+102
These patches enhance the Supplementary Service (SS) processing from only being able to handle USSD to other SS, specifically activation, deactivation and interrogation of those SS. Registration is not yet implemented. include/osmocom/gsm/protocol/gsm_09_02.h has been added with needed values for SS. Modified by Harald Welte to keep the old ussd-only functiosn for API/ABI stability.
2014-12-30fixupHarald Welte1-0/+4
2014-12-29add gsm0341_test to generate SMSCB hex stringsHarald Welte3-1/+59
Those hex strings can then be copy+pasted into the OSmoNITB VTY
2014-12-28log: "logging level everything" is a badly named option.Holger Hans Peter Freyther1-1/+1
We tried to fix it but it isn't that easy. The original fix was cd6ed82d1ff48f47ad9e33e6322df62896a76ed5 but we had to revert it as "everything" is present/used in existing config files. If we ever change the ABI we can make everything be something that is > 0. For now use a wording that makes it obvious that people should not use "everything".
2014-12-28libosmo-gsm: Add PCHAN/LCHAN types for CBCHHarald Welte1-0/+2
2014-12-22ipa: Return -errno instead of -1 in ipa_sendJacob Erlbeck1-1/+1
Currently, the ipa_send function returns -1 in one execution branch to indicate an error and -EIO in another. This is not consistent and can lead to a misinterpretation of the error code, since -1 is -EPERM and in general, EPERM is not returned by write(2). This patch changes the return code to -errno instead of -1 for the case that write(2) fails for same reason. So -rc is always a sensible error value if there is a failure. Sponsored-by: On-Waves ehf
2014-12-05logging: Call color only once and use the resultHolger Hans Peter Freyther1-1/+1
First we check if a color is defined and then we call it again and use the result. Avoid the second call and use the result of the previous call.
2014-12-05logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther2-4/+95
We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602
2014-12-04gtp: Add a global region for the gtp library of OpenGGSNHolger Hans Peter Freyther1-0/+5
We want to use libosmocore/libosmovty in the GGSN sourcecode and reserve a global region here.
2014-12-04vty: Check with the application before writing the configHolger Hans Peter Freyther1-0/+9
For the BSC/NITB application we see that people modify the band without modifying the ARFCN. This creates an unbootable config. Using the new hook the BSC/NITB can check if the config is consistent and prevent the config file being written. Related: SYS#739
2014-12-04fix libosmocore build for NuttX targetHarald Welte4-2/+18
this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
2014-11-14vty/vector.c: Use string.h, not memory.hHarald Welte1-1/+1
2014-11-14remove references to u_long type, use 'unsigned long' insteadHarald Welte2-3/+3
.. Nuttx doesn't know u_long
2014-11-14remove references to u_char type, use 'unsigned char' insteadHarald Welte2-2/+2
... u_char not being defined on Nuttx.
2014-11-14strrb.c: Use string.h, not strings.hHarald Welte1-1/+1
Not all systems have strings.h
2014-11-14select.c: Add missing #include lines for string.h and sys/select.hHarald Welte1-0/+2
This is needed on Nuttx.
2014-11-10bssgp: Fix VTY command 'show bssgp nsei N'Jacob Erlbeck1-1/+1
Currently this command segfaults (at least when ASAN is enabled), because when getting the NSEI the index to argv is wrong and out of bounds. This patch fixes the offset. Sponsored-by: On-Waves ehf
2014-10-27sim: reader_pcsc:Remove dead codeHarald Welte1-2/+0
PCSC_ERROR() macro is already performing error checking. Found by coverity.
2014-10-27pcsc: Fix the include pathHolger Hans Peter Freyther1-2/+2
The pkg-config file already points into the PCSC directory. This is needed for FreeBSD where /usr/local/include is not in the default compiler search path. On Debian $ pkg-config --cflags libpcsclite -pthread -I/usr/include/PCSC On FreeBSD $ pkg-config --cflags libpcsclite -I/usr/local/include/PCSC -D_THREAD_SAFE -pthread
2014-10-26sttrb / loggingrb: Use GPLv2+ as license, not AGPLv3+Harald Welte2-2/+2
according to Holger, using AGPLv3+ at the time was a mistake and the license should always have indicated GPLv2+.
2014-10-26Change copyright notice of ipa.c to GPLv2+Harald Welte1-4/+4
... which it should have been all along.
2014-10-26Change license of gsm0411_smc/smr to GPLv2+Harald Welte3-12/+12
libosmocore.{so,a} should always have been GPLv2+. However, when migrating some code from OpenBSC or OsmocomBB, we sometimes introduced it with a wrong license header.
2014-10-26Change license of libosmogb from AGPLv3+ to GPLv2+Harald Welte8-32/+32
The copyright holders Harald Welte, Holger Freyther, Andreas Eversberg and sysmocom - s.f.m.c. GmbH (represented by Holger and Harald) agree that the license of libosmogb should be GPLv2+ and not AGPLv3+. The reason the source files stated AGPLv3+ is due to the history, as they were moved from OpenBSC to libosmocore at the time we needed to use them from osmo-pcu. It was an oversight back then to not re-license them accordingly.
2014-10-26make sure to register DF.TELECOM and DF.GSM for SIM, USIM + TSIMHarald Welte4-42/+56
before we only did it partially, and by exporting data from sim, rather than the new osim_int_cprof_add_{gsm,telecom}() functions.
2014-10-26sim: More talloc return NULL checkingHarald Welte1-0/+8
2014-10-26sim: Prepare infrastructure for protocols != T=0 and other driversHarald Welte3-16/+40
2014-10-26sim: Make TETRA SIM (TSIM) support compileHarald Welte2-183/+134
2014-10-26sim: Only one default_decode() function for all card typesHarald Welte5-37/+15
2014-10-26sim: Add 3GPP TS 31.103 ISIM definitionsHarald Welte2-1/+117
2014-10-26sim: Update to latest SIM/USIM specs and include size informationHarald Welte3-175/+335
2014-10-26sim: reader_pcsc.c: Avoid compiler warnings by using pcsc-lite LONGHarald Welte1-3/+3
2014-10-26sim: mark osim_msgb_cb as __may_alias__ to avoid gcc warningsHarald Welte1-0/+315
2014-10-26sim: further updates/fixesHarald Welte4-3/+16
2014-10-26sim: add decoding of status wordsHarald Welte1-2/+54
2014-10-26sim: replaced function/structure comments with doxygen commentsKevin Redon1-8/+12
affected files: sim.h, sim/core.c affected funtions/strucutres: osim_new_apdumsg, osim_apdu_case,osim_apdu_cmd_hdr, osim_msgb_cb
2014-10-26sim: renamed case to the one defined in ISO7816-3Kevin Redon2-18/+18
APDU_CASE_2 becomes APDU_CASE_2S APDU_CASE_2_EXT becmoes APDU_CASE_2E APDU_CASE_3 becomes APDU_CASE_3S APDU_CASE_3_EXT becmoes APDU_CASE_3E APDU_CASE_4 becomes APDU_CASE_4S APDU_CASE_4_EXT becmoes APDU_CASE_4E