summaryrefslogtreecommitdiff
path: root/src/gateway
Commit message (Collapse)AuthorAgeFilesLines
* other: fix remaining conversion warningsDinh Cong Toan2021-01-061-2/+2
| | | | | | | | | | | - 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>
* gateway: fix compile warningsDinh Cong Toan(RBVH/ECM12)2021-01-061-18/+18
| | | | | | | | | - Correct the data type of 'headersize' and 'datasize' variables in header 'dlt_common.h', then config those functions using this library. - Explicit the data type. Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
* Add support for logging with VSOCK (#255)Martin Ejdestig2020-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* limit logspam in gateway on client overflowFelix Herrmann2020-07-061-5/+3
| | | | | | | | update client buffer overflow counter in send function. Gather all overflow checks into dlt_daemon_client. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* doc: md file for dlt_gateway.confBui Nguyen Quoc Thanh2020-07-061-2/+0
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Improvement of handling Gateway configBui Nguyen Quoc Thanh2020-07-061-10/+22
| | | | | | | | | | | | | | In the current implementation, we believe in user to treat General section as Mandatory. Hence system could be reset due to memory of connections incorrectly. At the moment, General could be handled as Optional with default value of interval. It means General could be absent from config file. Improvement is to raise WARNING to user, set default value and update the number of connections properly. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Support infinite loop of retryBui Nguyen Quoc Thanh2020-07-062-6/+17
| | | | | | | | | | | - In order to enable endless retry of reconnection, "Timeout" in dlt_gateway.conf must be set to 0. - In case of "Timeout" is an integer A and A is greater than 0, so after A times of retry, the connection to passive Node will be marked as DISABLED. There won't be any retry afterward. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* gateway: Configurable interval timeBui Nguyen Quoc Thanh2020-07-063-45/+167
| | | | | | | | | - Introduce "General" section for dlt_gateway.conf - In new section, the interval is used for gateway timer. This entry is optional. By default, it is set to 1 second as the existing hardcoded value. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* fix gateway config element searchFelix Herrmann2020-07-061-5/+4
| | | | | | | Only the first configured passive node was checked when a connection request was issued. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* Change the DLT_CHECK_RCV_DATA_SIZE macro to an internal function (#191)Sebastian Lipponer2019-11-251-2/+2
| | | | | | | | | The use of this macro in a if condition is actually non-standard C++ code. GCC issues a warning that ISO C++ forbids braced-groups within expressions when compiled with -Wpedantic. Other compilers fail with an error. Change the macro to an internal function in order to improve the portability to other platforms (i.e. MSVC, proprietary embedded). Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
* doxygen: Remove licenceSaya Sugiura2019-07-195-10/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Get rid of warningsSaya Sugiura2019-07-192-10/+14
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Fix compiler warningsSimon Herkenhoff2019-05-061-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-212-437/+260
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Cleanup of unit test fixesManikandan C2018-12-213-57/+64
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-214-21/+122
| | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | 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-15/+15
| | | | Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-302-7/+7
| | | | | | | | | | | 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-12/+11
| | | | | | | | | | | - 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-234-382/+897
| | | | | | | | | | | | | -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-152-0/+41
| | | | | | | | | | - 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-client: fix dlt_client_cleanup memory handlingOnkar Palkar2017-02-061-2/+7
| | | | | | | 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>
* Unit Test: MultiNodeOnkar Palkar2016-10-242-13/+40
| | | | | | Unit test for DLT MultiNode extension Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* MultiNode: Specify config file location in dlt.confChristoph Lipka2016-10-241-6/+9
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-client: Use correct port on connectChristoph Lipka2016-10-241-2/+0
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* dlt-daemon: Connection activation reworkFrederic Berat2016-04-281-6/+3
| | | | | | | | The activation of the connection is now centralized in one common function. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Change-Id: I86703eab411088905a85f526d5102875e2c92b7e
* MultiNode: Add support for mandatory configurationsFrederic Berat2016-04-281-233/+152
| | | | | | | | | | | Some configuration elements are mandatory, some other optionals. The Gateway configuration handler now supports both of them. If a mandatory configuration is missing, the Section is ignored, and next one is handled. If all sections are wrong, the Gaeteway fails its initialization. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Change-Id: I41177783e7c5cae528b54b48f558032e672c9451
* MultiNode: Add support for SerialHeader confFrederic Berat2016-04-283-24/+69
| | | | | | | | | | | The New SendSerialHeader configuration allows to define if a gateway needs this serial header to be sent. It can be configured differently for each gateway. If the configuration is not available, the DLT global configuration is used. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Change-Id: If37cb0dfc7e765a1752e438e61c1622ffb7dbc4f
* MultiNode: Add support for port configurationFrederic Berat2016-04-271-1/+12
| | | | | | Signed-off-by:Frederic Berat <fberat@de.adit-jv.com> Change-Id: I9b387d5713f5ae7b6fcfadb22d804fdb97534e44
* MultiNode: Send control messages after connectionChristoph Lipka2016-04-264-3/+273
| | | | | | | | | | | | | | | | | A list of control messages can be specified in the dlt_gateway.conf. These messages then are send immediately to the passive node after the connection has been established. Currently supported control messages are - GET_LOG_INFO - GET_SOFTWARE_VERSION Having the "SendControl" property is now mandatory for a passive node configuration, but the list of control messages might be empty. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I0ae4501449bf264c2d6f32724b0f035926115611
* MultiNode: Send serialheader if specified in dlt.confChristoph Lipka2016-04-251-0/+14
| | | | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: Iffbfb4693b172065d6000ecbf23342498341fa73
* MultiNode: Reconnection after connection lossChristoph Lipka2015-12-162-9/+22
| | | | | | | | | The Gateway DLT Daemon will try to reconnect to a passive node once after the connection was lost. The maximum number of reconnects can be configured by changing the DLT_GATEWAY_RECONNECT_MAX definition. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Dlt MultiNodeChristoph Lipka2015-12-075-0/+1358
MultiNode allows to connect DLT Daemons running on different operating systems, e.g. in a virtualized environment. The central component is the Gateway DLT Daemon which connects external DLT Clients, like the DLT Viewer running on a host computer, with Passive DLT Daemons running on nodes without a physical connection to external DLT clients. The Gateway DLT Daemon itself acts as a DLT client when connecting to a Passive DLT Daemon. To use the Gateway functionality, it has to be enabled in dlt.conf: GatewayMode = 1 All communication between passive nodes and DLT Viewer has to be send via the Gateway node. The Gateway node forwards log messages coming from passive nodes to all connected DLT clients. It also forwards command and control requests coming from DLT clients to the corresponding passive node. The Gateway DLT Daemon read a configuration file (dlt_gateway.conf) at startup with information about Passive DLT Daemon connections. Afterwards, the Daemon will try to connect to the passive DLT Daemons. If the connection cannot be established after the configured timeout, the Gateway DLT Daemon will give up connecting. The configuration file has to contain the following information about a passive node: [PassiveNode1] IPaddress = 192.168.2.35 Port = 3490 EcuID = ECU2 Connect = OnStartup ; timeout in seconds Timeout = 10 Precondition is, that the passive node is configured with the correct ECU id, ECU2 in this case. If the passive node sends messages with another than configured ECU id, the Gateway DLT Daemon will shut down the connection. It is also possible to connect to a passive DLT daemon using the dlt-passive-node-ctrl application. In this case "Connect=OnDemand" has to be configured in the configuration file. To connect to PassiveNode1, "dlt-passive-node-ctrl -n ECU2 -c 1" has to be executed. With "dlt-passive-node-ctrl -s" the status of passive node connections can be retrieved. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>