summaryrefslogtreecommitdiff
path: root/src/daemon/dlt-daemon.h
diff options
context:
space:
mode:
authorChristoph Lipka <clipka@jp.adit-jv.com>2015-10-16 16:55:27 +0900
committerLutz Helwing <lutz_helwing@mentor.com>2015-12-07 10:07:26 +0100
commit5acb7dd008a57f6da3bf7b9cf85cfc2c86cac151 (patch)
treeb6ddea5671215bc52b43d69a4b37b8481aa10d23 /src/daemon/dlt-daemon.h
parent280afb856b74e6089cdd2aa1af7f50c628583475 (diff)
downloadDLT-daemon-5acb7dd008a57f6da3bf7b9cf85cfc2c86cac151.tar.gz
Dlt MultiNode
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>
Diffstat (limited to 'src/daemon/dlt-daemon.h')
-rw-r--r--src/daemon/dlt-daemon.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h
index 02a55b3..2dffcc9 100644
--- a/src/daemon/dlt-daemon.h
+++ b/src/daemon/dlt-daemon.h
@@ -75,7 +75,7 @@
#include "dlt_user_shared.h"
#include "dlt_user_shared_cfg.h"
#include "dlt_daemon_event_handler_types.h"
-
+#include "dlt_gateway_types.h"
#include <dlt_offline_trace.h>
#include <sys/time.h>
@@ -123,8 +123,8 @@ typedef struct
char daemonFifoName[NAME_MAX + 1]; /**< (String: Filename) name of local fifo (Default: /tmp/dlt) */
unsigned int port; /**< port number */
char ctrlSockPath[DLT_DAEMON_FLAG_MAX]; /**< Path to Control socket */
+ int gatewayMode; /**< (Boolean) Gateway Mode */
} DltDaemonFlags;
-
/**
* The global parameters of a dlt daemon.
*/
@@ -137,6 +137,7 @@ typedef struct
int ctrlsock; /**< handle for control socket connection */
DltFile file; /**< struct for file access */
DltEventHandler pEvent; /**< struct for message producer event handling */
+ DltGateway pGateway; /**< struct for passive node connection handling */
DltMessage msg; /**< one dlt message */
DltReceiver receiver; /**< receiver for fifo connection */
DltReceiver receiverSock; /**< receiver for socket connection */
@@ -157,6 +158,7 @@ typedef struct
#if defined(DLT_SYSTEMD_WATCHDOG_ENABLE)
DltReceiver timer_wd; /**< file descriptor for watchdog timer */
#endif
+ DltReceiver timer_gateway; /**< timer for gateway reconnection handling */
} DltDaemonLocal;
typedef struct
@@ -188,16 +190,16 @@ int dlt_daemon_local_ecu_version_init(DltDaemon *daemon, DltDaemonLocal *daemon_
void dlt_daemon_daemonize(int verbose);
void dlt_daemon_signal_handler(int sig);
-int dlt_daemon_process_client_connect(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_client_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_client_messages_serial(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_user_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_one_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_sixty_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-int dlt_daemon_process_systemd_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
-
-int dlt_daemon_process_control_connect(DltDaemon *daemon, DltDaemonLocal *daemon_local,int verbose);
-int dlt_daemon_process_control_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local,int verbose);
+int dlt_daemon_process_client_connect(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_client_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *revc, int verbose);
+int dlt_daemon_process_client_messages_serial(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_user_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_one_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_sixty_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_systemd_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+
+int dlt_daemon_process_control_connect(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
+int dlt_daemon_process_control_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
int dlt_daemon_process_user_message_overflow(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
int dlt_daemon_send_message_overflow(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);