summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Apply uncrustify for src/daemon/* and src/lib/*Dinh Cong Toan2021-06-301-22/+40
| | | | | | Apply uncrustify for src/daemon/* and src/lib/* Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* dlt message header brokenDinh Cong Toan2021-06-301-2/+2
| | | | | | | | | | | | | This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* other: fix remaining conversion warningsDinh Cong Toan2021-01-061-1/+1
| | | | | | | | | | | - Converting datatype to the correct one. - As macro do not perform type-checking before, so these functions used it with different datatype could create a lot of conversion warnings. For this reason, these warnings could be consider as normal information and will not be fixed. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* daemon: fix conversion warningsiod1hc2021-01-061-1/+1
| | | | | | | | | | | | | - Instead of casting frequently, change the data type of 'to_remove' to 'uint32_t' for the correct format, also adding temp variable to check return value. - Change data type of 2 variable 'offset' and 'sizecont' to 'size_t' (dlt_daemon_client.c), because these variable using many time with function 'sizeof', and they was used as local variable so it will not effect dlt library. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* dlt-daemon.c: exit early on error (#261)Moritz Warning2020-11-121-3/+6
| | | | | | Change warning to error, as it will abort the daemon startup. Also reduce the amount of follow up error messages. Signed-off-by: Moritz Warning <moritzwarning@web.de>
* network trace: Include necessary headersSaya Sugiura2020-07-061-2/+0
| | | | | | | | | | | Some components which links dlt seem to depend on following headers, which will be included by mqueue.h. - sys/types.h - fcntl.h So explicitly include them if mqueue interface is not supported in dlt_user.h. Also two headers are removed if dlt_used.h is included. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* fix clang warnings about GNU stuffFelix Herrmann2020-07-061-5/+6
| | | | | Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* dlt_daemon_socket: leave while socket binds failsPhong Tran2019-12-111-0/+1
| | | | | | | CID 351398 (#1 of 1): Use after close (USE_AFTER_FREE) 8. pass_closed_arg: Passing closed handle *sock as an argument to dlt_daemon_socket_get_send_qeue_max_size Signed-off-by: Phong Tran <tranmanphong@gmail.com>
* Fix compiler warnings: pointer of type ‘void *’ used in arithmetic (#196)Sebastian Lipponer2019-12-101-1/+1
| | | Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* 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-031-43/+49
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Add option in dlt.conf for bindAddress to specific IPs (#130)"Saya Sugiura2019-08-011-49/+43
| | | | This reverts commit e8716cc5c950e50411b23a7a6cafa3c063c59e90.
* Add option in dlt.conf for bindAddress to specific IPs (#130)AdrianStoenescu2019-07-251-43/+49
| | | | | | | | | | | | | | | | | | | | | | | 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
* 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-11/+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>
* daemon: Remove bytes_sentSaya Sugiura2019-06-181-8/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Code beautification using uncrustifyChristoph Lipka2018-12-211-33/+33
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-211-3/+1
| | | | | | | | | | | | 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-211-31/+33
| | | | | | | | 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>
* Fix compiler warning PR #77Christoph Lipka2018-09-251-1/+1
| | | | | | warning: extra tokens at end of #ifdef directive Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Fix compilation with glibc 2.28 (#77)Oleksndr Kravchuk2018-09-251-1/+1
| | | | | | | | Package compilation fails with GLIBC 2.28: stat.h:56:8: error: redefinition of 'struct statx_timestamp' stat.h:99:8: error: redefinition of 'struct statx' Signed-off-by: Oleksandr Kravchuk <oleksandr.kravchuk@pelagicore.com>
* improve error reporting in dlt_daemon_socket (#41)Florian Castellane2018-02-141-14/+17
| | | | | | * improve error reporting in dlt_daemon_socket * use dlt_vlog
* fix PR #26 socket_sendreliable data_send updateChristoph Lipka2018-01-191-1/+5
| | | | | | do not update data_send in case of temporal error Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Prevention for occasional corrupted messages (#26)baduras2018-01-121-9/+37
| | | Prevention for occasional corrupted messages caused mostly due to system high load.
* dlt-daemon: Make IP version compile time configurableS. Hameed2015-12-071-0/+4
| | | | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-071-24/+24
| | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | - 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>
* 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-10/+17
| | | | | | Scan findings. Renamed and cleanup further files. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Reworked internal outputSascha Philipp2015-03-251-6/+6
| | | | | | Change-Id: I371c1b234929fda46608f563f08cae141b97d0a9 Signed-off-by: Ralf Anton Beier <ralf.anton.beier@continental-corporation.com> Signed-off-by: Sascha Philipp <sascha.philipp@continental-corporation.com>
* Add the IPv6 supportJiri Popek2015-03-231-34/+51
| | | | | | | 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>
* Fixed: all possible malloc, sprintf and strcpy problemsAlexander Wenzel2014-04-011-4/+4
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated authors information.Alexander Wenzel2014-04-011-32/+5
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Cygwin port: cygwin patch, signal handling patch and cppcheck and install ↵Alexander Wenzel2014-04-011-1/+5
| | | | | | lib dll to correct location on Windows. Originally from Mikko Rapeli <mikko.rapeli@bmw.de>. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added log output of created socket/port In init phase 2 - socket creationChristian Muck2014-01-231-2/+10
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Cleanup of send return values. Further cleanup of send restructure.Alexander Wenzel2014-01-101-4/+20
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Moved daemon client functions to new source file.Alexander Wenzel2014-01-101-7/+67
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Centralised send function to client. Introduced connection state to dlt daemon.Alexander Wenzel2014-01-101-0/+90
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>