summaryrefslogtreecommitdiff
path: root/src/lib/dlt_client.c
Commit message (Collapse)AuthorAgeFilesLines
* library: fix conversion warningsDinh Cong Toan(RBVH/ECM12)2021-01-061-18/+19
| | | | | | | | | | | | - Change the data type of variable 'size' in DltContextData struct (dlt_user.h.in). Variable 'size' was used repeated with function 'sizeof()' many time, so change type to 'size_t' can avoid a lot of warnings. - Adding temporary variable to calculate the datasize header (define in dlt_common.h) in 'dlt_common.c' file. Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* Add support for logging with VSOCK (#255)Martin Ejdestig2020-12-141-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For more information about VSOCK, see "man vsock" ( https://man7.org/linux/man-pages/man7/vsock.7.html ). Makes it possible for processes in a virtual machine to log directly in DLT running on host without setting up a network connection between guest and host. It is also probably more efficient. Have not done any performance measurements (not main reason for patch), but no forwarding is required as when running DLT in a multi-node setup. When building dlt-daemon for host, WITH_DLT_DAEMON_VSOCK_IPC should be enabled for daemon to listen on incoming VSOCK requests. Local communication method between applications and daemon is still determined with DLT_IPC. When building for guest, WITH_DLT_LIB_VSOCK_IPC should be enabled and DLT_IPC will be ignored, which will make libdlt open a VSOCK socket to the deamon for logging messages. VSOCK can be tested without a virtual machine. Since VMADDR_CID_HOST is used by libdlt when connecting, see vsock man page, clients can be run on host to test VSOCK communication. Some modifications has been done to be able to handle logging through FIFO pipe and socket in the same build of dlt-daemon: - dlt_receiver_init/free_unix_socket() is renamed to dlt_receiver_init/free_global_buffer() and used for FIFO as well. Also fixes memory leak since dlt_receiver_free_unix_socket() was used regardless of whether DLT_USE_UNIX_SOCKET was defined or not. - Pass type to dlt_receiver_init() instead of dlt_receiver_receive(). And remove preprocessor conditionals for handling DLT_CONNECTION_APP_MSG in dlt_daemon_process_user_messages(). Also fixes wrong enum type being passed to dlt_receiver_receive() in dlt_client.c (DltClient::mode was used as a DltReceiverType enum but it is a DltClientMode enum). - Add a flag to DltDaemonApplication to indicate whether file descriptor is "owned" by the DltDaemonApplication or not. When dlt_daemon_application_add() is called due to message received on a socket, fd is passed as an argument (app does not own fd). For FIFO, a per application FIFO is opened (app owns the fd). Also fixes so that user handle is reset for both application and all its contexts when resetting any. Prevents fd from being used by accident after it has been closed. dlt_mkdir_recursive() is moved to src/daemon since it is only used in the daemon. Minimizes use of DLT_USE_UNIX_SOCKET_IPC. Other bugfixes: - Call DLT_SEM_FREE() if setting socket to O_NONBLOCK fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). - Close socket if dlt_receiver_init() fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). Signed-off-by: Martin Ejdestig <martin.ejdestig@volvocars.com>
* dlt_client.c: remove misleading error message (#258)Moritz Warning2020-11-171-3/+3
| | | | | | Several IP address might be tested for connect. Only output an error if no address succeeds at all. Signed-off-by: Moritz Warning <moritzwarning@web.de>
* Implement DLTClient for UDP multicast (#240)João Sousa2020-08-311-1/+81
| | | | | | | | | * Add UDP multicast support on client side UDP multicast support is already present on server side. This patch add seemless support for UDP multicast on client side in dlt-receive. Signed-off-by: Joao Sousa <joao.sa.sousa@ctw.bmwgroup.com>
* doxygen: Remove licenceSaya Sugiura2019-07-191-2/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cleanup: Use dlt_vlog()Saya Sugiura2019-06-191-10/+3
| | | | | | | There were a couple of places which used snprintf-dlt_log. It is now replaced with dlt_vlog(). Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Fix alerts from lgtmSaya Sugiura2019-06-191-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-receive: Fix crash without argumentsVo Trung Chi2019-05-061-4/+6
| | | | | | Rootcause: Free uninitialize memory. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Fix compiler warningsSimon Herkenhoff2019-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix compiler warnings about socket usage Correct the data types used for the socket declaration. We use AF_UNIX sockets so we use struct sockaddr_un, but we need to cast to struct sockaddr for the socket API. Fix compiler warnings about sign-compare Fix two occurences of signed - unsigned comparison by casting the values accordingly. Note that the cast is legal as the first parts of both conditional statements make sure the value is not negative before casting to unsigned. While at it, add strtol error checking. Fix compiler warnings about string functions Add string.h to src/daemon/dlt_daemon_unix_socket.c, because it was unaware of memcpy and strerror. While at it, change unsafe use of sprintf to proper dlt_vlog and remove the char buffer. Fix compiler warnings about unused-* Fix two unused-variable and one unused-parameter warning. While at it, change the #ifdef to not run into an empty block. Simply reverse the condition and enclose the complete else with the #ifdef. POSIX: Use memset instead of bzero "The bzero() function is deprecated (marked as LEGACY in POSIX.1-2001); use memset(3) in new programs." Use memset instead of bzero and remove any occurrence from DLT. Include of header "strings.h" that has bzero is also removed. Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-211-358/+272
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Cleanup of unit test fixesManikandan C2018-12-211-7/+15
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-211-6/+16
| | | | | | | | | | | | Gateway Logstorage Event Handler Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Aditya Paluri <venkataaditya.paluri@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Dynamic allocation of msg bufferManikandanC2018-12-101-10/+2
| | | | | | | | | | | | | It is possible to change the default buffer size for log message creation via environment variable: export DLT_LOG_MSG_BUF_LEN=<value> Instead of using a static buffer with size of 1390 bytes, the buffer is allocated dynamically with the specified value.The max size is restricted to approx 65k. Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* rename #define STATIC to DLT_STATICManikandan C2018-12-061-1/+1
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* dlt-client: logging: Extended the receiver buffer sizeManikandan C2018-11-231-3/+3
| | | | | | | | | | | - dlt-control couldn't receive all the GET_LOG_INFO response message when many applications and contexts are registered. Therefore the receiver buffer size was extended to 65K. Also the receive buffer size macros are reduced to one variable. - Code cleanup and improvements Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Gateway ImprovementsManikandan C2018-11-231-37/+342
| | | | | | | | | | | | | -Support to send and parse periodic control messages -add application/contexts to passive ECU list -Refactor dlt_gateway_send_control_message -Gateway issues with corrupted data and on demand connection -Unit Test update Signed-off-by: Saya Sugiura ssugiura@jp.adit-jv.com Signed-off-by: Christoph Lipka clipka@jp.adit-jv.com Signed-off-by: S. Hameed shameed@jp.adit-jv.com Signed-off-by: ManikandanC Manikandan.Chockalingam@in.bosch.com
* dlt-daemon: per ECU list of user information (#80)ManikandanChockalingam2018-10-301-2/+2
| | | | | | Prepare daemon to store applications/context information of other ECUs as well. This commit prepares the dlt-daemon to store logs from passive nodes in a logstorage device. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Introduce controlling entire system trace status feature from dlt-control (#57)Yusuke Sato2018-05-181-0/+37
| | | | | | | | | | | | | | | | | | | | | * dlt-control: Provision to control entire system trace status 1. support for setting trace status using wildcards for both app and context 2. support for setting entire system trace status *This Logic is as same as for changing log level. (SHA: a966393ad7003d02870bceffa08df5ddf4bbf864 dlt-control: Provision to control entire system log level) * dlt-daemon: Fix control entire log level / trace status issue In previous, dlt-control could send request to set all log level / trace status with DLT_LOG_DEFAULT / DLT_TRACE_STATUS_DEFAULT(-1). However, dlt-daemon could not accept these value. This change fix this issue so that setting log level/trace status of all registered contexts become possible. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* dlt-client: fix dlt_client_cleanup memory handlingOnkar Palkar2017-02-061-0/+32
| | | | | | | Setter function introduced for seting up string parameters which are free'd in dlt_client_cleanup Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-client: Use correct port on connectChristoph Lipka2016-10-241-23/+31
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* CommonControl: Unix socket path and ecuid parsing for control applicationsManikandan C2016-04-281-1/+1
| | | | | | Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com> Change-Id: I023c6bccbe3977d50b77bb601df80643d8e2d82c
* dlt-control: Provision to control entire system log levelManikandan C2016-04-281-1/+31
| | | | | | | | 1. support for setting log level using wildcards for both app and context 2. support for setting entire system log level Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com> Change-Id: I92f8c5461903f092cd50f05f644013432940a87b
* MultiNode: Add support for port configurationFrederic Berat2016-04-271-10/+35
| | | | | | Signed-off-by:Frederic Berat <fberat@de.adit-jv.com> Change-Id: I9b387d5713f5ae7b6fcfadb22d804fdb97534e44
* Unix socket control interfaceChristoph Lipka2015-11-241-7/+43
| | | | | | | | | | | | | | | | Control applications running in the same Linux OS should be able to communicate with the DLT Daemon via a socket connection. To be able to do that, the DLT Client library need to be extended. DLT Clients connected via this UNIX socket are not handled as normal DLT Clients and no log messages will be forwarded to them. This avoids problems in situations when a control application is connected to the DLT Daemon before any other 'real' DLT Client (e.g. DLT Viewer) is connected. In this situations, all already stored log messages are flushed to the control application and therefore lost, because the control application most likely ignore all incoming messages besides the one in which it is interested in. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* GetLogInfo: supported get log info in dlt-controlManikandan C2015-11-181-0/+43
| | | | | | | added option to get log info in dlt-control app. The response parameter is parsed and the details are printed back to the console Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-071-306/+303
| | | | | | | | | | DLT daemon improvement - parameter value range check Adapt unit tests to check for enum return values Changed C version to gnu99 and C++ version to gnu++0c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Allow multiple instances of dlt-daemonStefan Vacek2015-10-071-2/+15
| | | | | | | | | | | | | | | | - Make dlt-daemon configurable to specify directory of fifos and port of dlt-daemon, this allows to run multiple instances of dlt-daemon at one node at the same time. This is useful in testing environment where simultanous tests should not interfere due to the same instance of dlt-daemon - dlt-daemon: add option -t <dir> to specify a directory where all fifos will be created - dlt-daemon: add option -p <port> to specify the port under which dlt-daemon can be connected - client-library: add environment variable DLT_PIPE_DIR to specify a non-default directory of fifos for logging applications - client-library: add environment variable DLT_DAEMON_TCP_PORT to specify the port under which dlt-daemon can be reached (especially when using dlt-receive) Signed-off-by: Stefan Vacek <stefan.vacek@intel.com> Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Cleanup masterStefan Vacek2015-10-071-0/+0
| | | | | | | - remove compiler warnings - fix file permissions Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Fixed license headers and copyright doxygen commentsLutz Helwing2015-06-171-2/+2
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated license headers to latest GENIVI license policy. Fixed further LRT ↵Lutz Helwing2015-06-171-11/+15
| | | | | | Scan findings. Renamed and cleanup further files. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Add the IPv6 supportJiri Popek2015-03-231-18/+27
| | | | | | | Enables communication between DLT server and clients over IPv6. Signed-off-by: Jiri Popek <jiri.popek@bmw.de> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Defined return value for dlt_message_read().Alexander Wenzel2014-01-101-1/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added additional command line commands.Alexander Wenzel2013-10-181-0/+119
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added command line commands set log level and set trace status.Alexander Wenzel2013-10-181-1/+64
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Implementation of command line tool dlt-control.Alexander Wenzel2013-10-181-11/+38
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Removed most warnings caused by: Wunused-but-set-variable flag. Eome were ↵Simon Brandner2013-07-191-2/+10
| | | | | | kept, because they were the nicer variant to eliminate them, or they seemed reserved for an commandline argument Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed compile warnings with unused parametersChristian Muck2012-06-131-0/+10
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* [GDLT-70] Check for malloc failures and return errors where applicable.Lassi Marttala2012-05-301-0/+5
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GENDLT-15, Safe re-allocations for databuffer.Lassi Marttala2012-04-041-2/+6
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* Corrected email of Alexander WenzelChristian Muck2012-03-271-1/+1
| | | | Signed-off-by: Christian Muck <christian.muck@bmw.de>
* GDLT-38, Update <FILE> fields in licenses.Lassi Marttala2012-03-261-1/+1
|
* GDLT-38, Update licenses to all the sources.Lassi Marttala2012-03-261-31/+16
|
* Init of dlt daemonChristian Muck2011-04-111-0/+452