aboutsummaryrefslogtreecommitdiffstats
path: root/src/logging_gsmtap.c
AgeCommit message (Collapse)AuthorFilesLines
2019-03-27logging_gsmtap.c: document all params of log_target_create_gsmtap()Vadim Yanitskiy1-0/+4
Change-Id: Id7bd6b4fb4be571af351f77aa4a59b9e1076434f
2018-12-28logging/gsmtap: fix buffer overflow in _gsmtap_raw_output()Vadim Yanitskiy1-0/+6
According to the man page, vsnprintf() returns: - a negative value in case of error; - the number of characters written (excluding '\0'); - the number of characters which *would have been written* if enough space had been available (excluding '\0'). We need to detect if the output was truncated, and properly limit the amount of bytes to be reserved within a msgb. Change-Id: Ifa822edf900ed925ba935c54a28c797c4657358a
2018-02-16memleak: _gsmtap_raw_output(): free msg in case of vsnprintf failureNeels Hofmeyr1-1/+3
Don't just return, free the allocated msg first. Change-Id: I51431ae7baca33ce5bab085cc3efe25f1a10b6d1
2018-02-16memleak: fix all libosmocore callers of gsmtap_sendmsg() to free on failureNeels Hofmeyr1-1/+3
gsmtap_sendmsg() does not free the msgb if it returns a failure rc, so the callers must check the rc and free the msg. Change-Id: I7cf64ed9b14247298ed8b4ab8735627f8235a499
2018-02-05utils: add helper wrapper for osmo_strlcpy()Max1-4/+3
Add wrapper for osmo_strlcpy() which uses sizeof() to automatically determine buffer's size and use it for GSMTAP logging. This is pretty common use case for osmo_strlcpy() so it's a good idea to save some typing by using generic define. Related: OS#2864 Change-Id: I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b
2018-01-12logging-gsmtap: send only basename of source fileNeels Hofmeyr1-0/+5
GSMTAP doesn't have a lot of space for the source file name. It is better to send only the basename of the file, because only the first bit of a long path may not convey the source file at all, needing guess work from the line number. Before: "Source File Name: ../../../../src/libosmocore/src" After: "Source File Name: telnet_interface.c" Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8
2017-11-13Fix/Update copyright notices; Add SPDX annotationHarald Welte1-0/+2
Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-12/+10
Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr1-2/+2
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-06-12update/extend doxygen documentationHarald Welte1-1/+7
It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
2017-05-15use osmo_{htonl,htons,ntohl,ntohs}() functions all over libosmocoreHarald Welte1-4/+4
This gets us one step closer to fixing the embedded build Change-Id: I3fc2639b6ade9ab138766987eceab7ec9498fdc7
2016-12-09Implement GSMTAP log targetHarald Welte1-0/+134
This target wraps the to-be-logged string (With metadata) into a GSMTAP packet and sends it to the configured destination address. Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625