summaryrefslogtreecommitdiff
path: root/src/daemon
Commit message (Collapse)AuthorAgeFilesLines
* dlt-daemon: correct errno usageVo Trung Chi2019-09-031-7/+9
| | | | | | | The errno must be saved in order to use with dlt_vlog() because the errno will be overwriten in dlt_vlog(). Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* dlt-daemon: fix bug binding invalid ipv6 address as defaultVo Trung Chi2019-09-031-2/+5
| | | | | | | The default INADDR_ANY is used ("0.0.0.0") as before. But it's invalid when DLT_USE_IPv6 flag ON. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Add option in dlt.conf for bindAddress to specific IPs (#130)AdrianStoenescu2019-09-035-70/+155
| | | | | | | | | | | | | | | | | | | | | | | | Add the possibility to have in dlt.conf an option that specifies a set of IP addresses. The daemon will do a socket bind only for this list, therefore external connections will be limited to this set of IP addresses. If this option is not given, the default INADDR_ANY is used ("0.0.0.0") as before. The option in dlt.conf can look like this: BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99 There can be as many addresses but only specified on one single line. They have to be delimited by ',' or ';'. ' ' (space) delimiter does not work. IPv6 addresses are supported as well. For instance: BindAddress = fe80::255:7bff:feb5:7df7 IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is OFF at compile time. One cannot have both IPv4 and IPv6 format in the same time. Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
* protocol: Remove non supported user service ID (#159)Saya Sugiura2019-09-021-11/+11
| | | | | | | | | | With this commit, following DLT user service IDs are now free to use: - 0xF0A - 0xF0F to 0xFFE Also the cases in dlt_daemon_client_process_control() is reordered so that it matches the order of dlt_user_services enum. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* UDP Multicast implementation (#155)Sunil-K-S2019-08-239-2/+460
| | | | | The feature can be enabled by setting WITH_UDP_CONNECTION to ON. Signed-off-by: sunil.s <sunil.s@lge.com>
* daemon: fix compile error with DLT_IPC="UNIX_SOCKET" (#153)Vo Trung Chi2019-08-021-0/+2
| | | Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* using POSIX shared memory APIs (#90) (#151)Vo Trung Chi2019-08-012-4/+34
| | | | | Replace all Linux specific shared memory APIs with POSIX alternatives. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Revert "Add option in dlt.conf for bindAddress to specific IPs (#130)"Saya Sugiura2019-08-015-152/+70
| | | | This reverts commit e8716cc5c950e50411b23a7a6cafa3c063c59e90.
* Add option to set owner group of daemon FIFO (#122)Jiri Popek2019-07-253-3/+47
| | | | | | | | | | New option to set owner group of daemon FIFO (Default: /tmp/dlt) is added in dlt.conf. If this option is used properly, more secure tracing can be realized. Only application that is in dlt_user_apps_group can write log message to daemon FIFO. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* Add option in dlt.conf for bindAddress to specific IPs (#130)AdrianStoenescu2019-07-255-70/+152
| | | | | | | | | | | | | | | | | | | | | | | Add the possibility to have in dlt.conf an option that specifies a set of IP addresses. The daemon will do a socket bind only for this list, therefore external connections will be limited to this set of IP addresses. If this option is not given, the default INADDR_ANY is used ("0.0.0.0") as before. The option in dlt.conf can look like this: BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99 There can be as many addresses but only specified on one single line. They have to be delimited by ',' or ';'. ' ' (space) delimiter does not work. IPv6 addresses are supported as well. For instance: BindAddress = fe80::255:7bff:feb5:7df7 IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is OFF at compile time. One cannot have both IPv4 and IPv6 format in the same time. Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
* Correct sa findingsSaya Sugiura2019-07-242-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dlt_offline_logstorage.c - Parameter to isdigit is not correct - Handle the size of memset() and strncpy() properly dlt-test-stress-user.c - Parameter d is duplicated dlt_env_ll.c - Parameter env is used before NULL check - Remove redundant line dlt-control-common.c dlt_daemon_event_handler.c - Do not use NULL variable to print log dlt_config_file_parser.c - Remove unnecessary loop dlt_daemon_client.c - Return error in NULL check dlt_user.c - Free allocated memory in error case Related commit: 5c8f88d logstorage: fix compile error Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Align variable for apid and ctidSaya Sugiura2019-07-194-108/+109
| | | | | | | The variables used for application id and context id are aligned with "apid" and "ctid". Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Remove licenceSaya Sugiura2019-07-1924-48/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Get rid of warningsSaya Sugiura2019-07-197-20/+28
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* define DLT_PATH_MAX for max path buffer lengthRadoslaw Kaczorowski2019-07-032-10/+13
| | | | | | | | DLT limits the path length and does not do anything else to determine the actual value, because the least that is supported on any system that DLT runs on is 1024 bytes. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* cmake-improvements (#135)Vo Trung Chi2019-07-031-11/+41
| | | | | | | | | | | | | | | 1. Allow building as a subproject of another cmake project (CMAKE_* vs PROJECT_* variables) 2. Do not generate header files within source – bad practice, use build directory for that(e.g. change location where dlt_version.h is being generated) 3. Use add_compile_options() instead of *_C/CXX_FLAGS variables for proper compile environment definition, also bad practice, also see p.2 4. Add WITH_DLT_PKGCONFIG – add generate pkgconfig .pc files as switchable option, should probably be part of headers install routine. Signed-off-by: Radoslaw Kaczorowski <external.radoslaw.kaczorowski@bosch-softtec.com>
* cleanup: Use dlt_vlog()Saya Sugiura2019-06-196-223/+79
| | | | | | | 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-192-13/+11
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Loop for client fdsVo Trung Chi2019-06-183-19/+21
| | | | | | | | | | | | In dlt_daemon_client_send_all_multiple(), while in the loop, the connection to client may be destroyed by recursive call to dlt_daemon_close_socket(). So in some scenario we still use the removed connection, which is unexpected behavior. Solution: loop on the fds array and find the client connection corresponds to. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* daemon: Remove bytes_sentSaya Sugiura2019-06-184-41/+6
| | | | | | | | | | | | | | | | | | | | | When it fails to send a log message to connected client, daemon tries to store the remaining partial message to internal ring buffer and send again later. When calculating the number of bytes which were sent to client, it had a bug which it keeps on incrementing instead of initializing the variable on every message, which never reached to the condition mentioned above and had a possibility to overflow and access invalid memory. On the other hand, daemon doesn't need to store the unsent partial message, as the socket to the client will be closed on failure and the sent partial message will be dropped anyways. This commit removes the lines where the daemon tries to store the partial message to ring buffer. With this, variable bytes_sent is now removed. Related commit: 2262f8b Made socket send reliable Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Don't remove unregistered contextBui Nguyen Quoc Thanh2019-06-183-1/+15
| | | | | | | | If a context is defined and loaded from runtime context config file, that context won't be deleted/removed from dlt-daemon database until its parent application is unregistered. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* daemon: Don't assign fd after freeBui Nguyen Quoc Thanh2019-06-181-3/+0
| | | | | | Do not assign fd after destroying receiver pointer Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Logstorage: Sync behavior bug fixSaya Sugiura2019-06-181-0/+11
| | | | | | | | | | | | | | | This commit fixes couple of unexpected behavior on Logstorage sync behavior. - A log file is created only if necessary to avoid creating an empty log file. - The cache is synced with the condition: 1) When the ring buffer is not wrapped around, the cache is synced from last sync offset to current offset 2) When the ring buffer is wrapped around for first time and current offset is smaller than last sync offset, the cache is synced from last sync offset to end sync offset, and then from beginning to current offset 3) Otherwise, the cache is synced from offset where the log message starts to end sync offset, and then from beginning to current offset Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-daemon: fix internal logging to file after daemonizeChristoph Lipka2019-05-061-0/+5
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Offline logstorage: Fix storage handle NULL check during cleanupS. Hameed2019-05-061-1/+1
| | | | Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* Fix compiler warningsSimon Herkenhoff2019-05-062-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* unix socket: IPC code isolationChristoph Lipka2019-05-062-2/+3
| | | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* lib: daemon: Fix sem lock potential issueSaya Sugiura2019-04-241-2/+6
| | | | | | | | sem_wait may return an error if a signal is received while waiting for the lock,and therefore not take the lock before returning. Changed to have a while loop. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* socket: Remove unnecessary headerSaya Sugiura2019-04-241-1/+0
| | | | | | | | Including net/if.h leads to duplicate definition of DLT_RAW. However the header itself is not required in dlt_daemon_socket.c. So it is now removed from the file. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* dlt-daemon: unlink application socketS. Hameed2019-04-241-0/+5
| | | | Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* dlt_offline_logstorage: fix multiple file creation error (#85, #94)Vo Trung Chi2019-03-251-49/+61
| | | | | | | | | | | | | | | | | | Rootcause: The dlt-daemon rotates files for each key, but not for each [FILTER] because dlt-daemon creates the DltLogStorageFilterConfig for each key (CTXT: or APPID: or APPID:CTXTID) then added to the DltLogStorageFilterList. And each DltLogStorageFilterConfig has it's own records (The list of files that was recorded in the offline logstorage directory), that's why one [FILTER] might be has multiple records and then its lead to the problem. Solution: Instead of creating the DltLogStorageFilterConfig for each key, dlt-daemon will create the DltLogStorageFilterConfig for each [FILTER] and DltLogStorageFilterConfig has an information of all the keys in this [FILTER]. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-2119-3510/+3025
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* dlt-daemon: Output current number of connections as defaultYusuke Sato2018-12-211-15/+18
| | | | | | | | | | In previous, number of connections was output only if verbose mode in dlt.conf was enabled. This information is basically useful and is not output frequently. Therefore number of connections information is made to output as default when new connection is established or the connection is lost. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
* Cleanup of unit test fixesManikandan C2018-12-212-14/+7
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* exit DLT daemon if /dev/null open fails during forkJeevan Ramakant Nagvekar2018-12-211-0/+5
| | | | | | | If /dev/null fails to open during DLT daemon's fork handling, it is treated as an error and DLT daemon exits. Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* Improvement - use dup2 in place of dup in daemon forkJeevan Ramakant Nagvekar2018-12-211-16/+19
| | | | | | | | | | | 1> While daemonizing DLT, for connecting I/O file descriptors to /dev/NULL POSIX call dup() is used. dup2() POSIX call is now used where explicit standard I/O descriptor number is mentioned. 2>After fork() directory changed to root in place of FIFO Base directory - "/tmp" Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* Remove one-instance-lock mechanismJeevan Ramakant Nagvekar2018-12-212-36/+1
| | | | | | | | | | | | | | This commit removes DLT's "one-instance-lock" mechanism. In daemonized mode, on first instance, a file is created (if not already created) and locked. If second instance is attempted file locking fails since the file is already locked by first instance. This prevents new instance of the DLT daemon. After analysis its found that there is no need of any mechanism for prevention of another instance. The same is already taken care by socket mechanism. Since main socket is created by first instance, attempt to create it again with same port number fails. Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
* daemon: Add exit triggerSaya Sugiura2018-12-212-13/+19
| | | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-2111-21/+114
| | | | | | | | | | | | 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>
* Made socket send reliableManikandan C2018-12-214-48/+81
| | | | | | | | Made TCP socket send reliable by storing the unsent/partial message in the ring buffer. This will avoid the corrupted messages/Gaps in Viewer side Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Removed log level change callback notification while context register done ↵Ravi Sankar P2018-12-211-6/+10
| | | | | | with ll_ts API Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com>
* Fixed compiler error with previous commitManikandan C2018-12-121-1/+1
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* Dynamic allocation of msg bufferManikandanC2018-12-103-10/+27
| | | | | | | | | | | | | 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-063-16/+16
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-307-112/+201
| | | | | | | | | | | The poll system call is now used in the daemon to enable DLT use in POSIX compliant systems. Also added introduced new unregister_app macro to avoid missing of logs in startup buffer. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* dlt-client: logging: Extended the receiver buffer sizeManikandan C2018-11-231-1/+0
| | | | | | | | | | | - 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>
* Protocol: DLT Service ID Enum instead of definesManikandan C2018-11-231-1/+1
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Gateway ImprovementsManikandan C2018-11-233-24/+45
| | | | | | | | | | | | | -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
* Log storage - Updates (#82)ManikandanChockalingam2018-11-155-364/+1071
| | | | | | | | | | - improvements and refactor key creation - Sync strategies added Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-daemon: per ECU list of user information (#80)ManikandanChockalingam2018-10-305-342/+881
| | | | | | 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>