From ed412acac8e9f8a5745e55adeed9652b34b9ee4f Mon Sep 17 00:00:00 2001 From: Stefan Vacek Date: Mon, 31 Aug 2015 10:13:07 +0200 Subject: Allow multiple instances of dlt-daemon - 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 to specify a directory where all fifos will be created - dlt-daemon: add option -p 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 Signed-off-by: Lutz Helwing --- include/dlt/dlt_common.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index 10334ca..da9835c 100644 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -76,6 +76,7 @@ */ #include +#include #if !defined(_MSC_VER) #include @@ -186,12 +187,12 @@ enum { }; /** - * The standard TCP Port used for DLT daemon + * The standard TCP Port used for DLT daemon, can be overwritten via -p when starting dlt-daemon */ #define DLT_DAEMON_TCP_PORT 3490 -/* Initi value for file descritpor */ +/* Initial value for file descriptor */ #define DLT_FD_INIT -1 /* Minimum value for a file descriptor except the POSIX Standards: stdin=0, stdout=1, stderr=2 */ @@ -331,7 +332,11 @@ extern const char dltSerialHeader[DLT_ID_SIZE]; extern char dltSerialHeaderChar[DLT_ID_SIZE]; /** + * The common base-path of the dlt-daemon-fifo and application-generated fifos + */ +extern char dltFifoBaseDir[PATH_MAX + 1]; +/** * The type of a DLT ID (context id, application id, etc.) */ typedef char ID4[DLT_ID_SIZE]; @@ -1287,6 +1292,12 @@ extern "C" */ void dlt_check_envvar(); + /** + * Create the specified path, recursive if necessary + * behaves like calling mkdir -p on the console + */ + int dlt_mkdir_recursive(const char *dir); + #ifdef __cplusplus } #endif -- cgit v1.2.1