summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/dlt_daemon_common.h')
-rw-r--r--src/daemon/dlt_daemon_common.h121
1 files changed, 104 insertions, 17 deletions
diff --git a/src/daemon/dlt_daemon_common.h b/src/daemon/dlt_daemon_common.h
index 5df66ed..bd81e0d 100644
--- a/src/daemon/dlt_daemon_common.h
+++ b/src/daemon/dlt_daemon_common.h
@@ -82,6 +82,7 @@
#include "dlt_common.h"
#include "dlt_user.h"
#include "dlt_offline_logstorage.h"
+#include "dlt_gateway_types.h"
#ifdef __cplusplus
extern "C" {
@@ -139,15 +140,25 @@ typedef struct
int8_t storage_log_level; /**< log level set for offline logstorage */
} DltDaemonContext;
+/*
+ * The parameter of registered users list
+ */
+typedef struct
+{
+ DltDaemonApplication *applications; /**< Pointer to applications */
+ int num_applications; /**< Number of available application */
+ DltDaemonContext *contexts; /**< Pointer to contexts */
+ int num_contexts; /**< Total number of all contexts in all applications in this list */
+ char ecu[DLT_ID_SIZE]; /**< ECU ID of where contexts are registered */
+} DltDaemonRegisteredUsers;
+
/**
* The parameters of a daemon.
*/
typedef struct
{
- int num_contexts; /**< Total number of all contexts in all applications */
- DltDaemonContext *contexts; /**< Pointer to contexts */
- int num_applications; /**< Number of available application */
- DltDaemonApplication *applications; /**< Pointer to applications */
+ DltDaemonRegisteredUsers *user_list; /**< registered users per ECU */
+ int num_user_lists; /** < number of context lists */
int8_t default_log_level; /**< Default log level (of daemon) */
int8_t default_trace_status; /**< Default trace status (of daemon) */
int8_t force_ll_ts; /**< Enforce ll and ts to not exceed default_log_level, default_trace_status */
@@ -189,7 +200,39 @@ int dlt_daemon_init(DltDaemon *daemon,unsigned long RingbufferMinSize,unsigned l
* @return negative value if there was an error
*/
int dlt_daemon_free(DltDaemon *daemon,int verbose);
-
+/**
+ * Initialize data structures to store information about applications running on same
+ * or passive node.
+ * @param daemon pointer to dlt daemon structure
+ * @param gateway pointer to dlt gateway structure
+ * @param gateway_mode mode of dlt daemon, specified in dlt.conf
+ * @param verbose if set to true verbose information is printed out
+ * @return DLT_RETURN_OK on success, DLT_RETURN_ERROR otherwise
+ */
+int dlt_daemon_init_user_information(DltDaemon *daemon,
+ DltGateway *gateway,
+ int gateway_mode,
+ int verbose);
+/**
+ * Find information about application/contexts for a specific ECU
+ * @param daemon pointer to dlt daemon structure
+ * @param ecu pointer to node name
+ * @param verbose if set to true verbose information is printed out
+ * @return pointer to user list, NULL otherwise
+ */
+DltDaemonRegisteredUsers *dlt_daemon_find_users_list(DltDaemon *daemon,
+ char *ecu,
+ int verbose);
+/**
+ * Loads the user saved configurations to daemon
+ * @param daemon pointer to dlt daemon structure
+ * @param runtime directory path
+ * @param verbose if set to true verbose information is printed out
+ * @return DLT_RETURN_OK on success, DLT_RETURN_ERROR otherwise
+ */
+int dlt_daemon_load_runtime_configuration(DltDaemon *daemon,
+ const char *runtime_directory,
+ int verbose);
/**
* Add (new) application to internal application management
* @param daemon pointer to dlt daemon structure
@@ -197,26 +240,41 @@ int dlt_daemon_free(DltDaemon *daemon,int verbose);
* @param pid process id of user application
* @param description description of application
* @param fd file descriptor of application
+ * @param ecu pointer to ecu id of node to add applications
* @param verbose if set to true verbose information is printed out.
* @return Pointer to added context, null pointer on error
*/
-DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon, char *apid, pid_t pid, char *description, int fd, int verbose);
+DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon,
+ char *apid,
+ pid_t pid,
+ char *description,
+ int fd,
+ char *ecu,
+ int verbose);
/**
* Delete application from internal application management
* @param daemon pointer to dlt daemon structure
* @param application pointer to application to be deleted
+ * @param ecu pointer to ecu id of node to delete applications
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_application_del(DltDaemon *daemon, DltDaemonApplication *application, int verbose);
+int dlt_daemon_application_del(DltDaemon *daemon,
+ DltDaemonApplication *application,
+ char *ecu,
+ int verbose);
/**
* Find application with specific application id
* @param daemon pointer to dlt daemon structure
* @param apid pointer to application id
+ * @param ecu pointer to ecu id of node to clear applications
* @param verbose if set to true verbose information is printed out.
* @return Pointer to application, null pointer on error or not found
*/
-DltDaemonApplication* dlt_daemon_application_find(DltDaemon *daemon,char *apid,int verbose);
+DltDaemonApplication* dlt_daemon_application_find(DltDaemon *daemon,
+ char *apid,
+ char *ecu,
+ int verbose);
/**
* Load applications from file to internal context management
* @param daemon pointer to dlt daemon structure
@@ -236,18 +294,23 @@ int dlt_daemon_applications_save(DltDaemon *daemon,const char *filename, int ver
/**
* Invalidate all applications fd, if fd is reused
* @param daemon pointer to dlt daemon structure
+ * @param ecu node these applications running on.
* @param fd file descriptor
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_applications_invalidate_fd(DltDaemon *daemon,int fd,int verbose);
+int dlt_daemon_applications_invalidate_fd(DltDaemon *daemon,
+ char *ecu,
+ int fd,
+ int verbose);
/**
- * Clear all applications in internal application management
+ * Clear all applications in internal application management of specific ecu
* @param daemon pointer to dlt daemon structure
+ * @param ecu pointer to ecu id of node to clear applications
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_applications_clear(DltDaemon *daemon,int verbose);
+int dlt_daemon_applications_clear(DltDaemon *daemon,char *ecu, int verbose);
/**
* Add (new) context to internal context management
@@ -259,42 +322,66 @@ int dlt_daemon_applications_clear(DltDaemon *daemon,int verbose);
* @param log_level_pos offset of context in context field on user application
* @param user_handle connection handle for connection to user application
* @param description description of context
+ * @param ecu pointer to ecu id of node to add application
* @param verbose if set to true verbose information is printed out.
* @return Pointer to added context, null pointer on error
*/
-DltDaemonContext* dlt_daemon_context_add(DltDaemon *daemon,char *apid,char *ctid,int8_t log_level,int8_t trace_status,int log_level_pos, int user_handle,char *description,int verbose);
+DltDaemonContext* dlt_daemon_context_add(DltDaemon *daemon,
+ char *apid,
+ char *ctid,
+ int8_t log_level,
+ int8_t trace_status,
+ int log_level_pos,
+ int user_handle,
+ char *description,
+ char *ecu,
+ int verbose);
/**
* Delete context from internal context management
* @param daemon pointer to dlt daemon structure
* @param context pointer to context to be deleted
+ * @param ecu pointer to ecu id of node to delete application
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_context_del(DltDaemon *daemon, DltDaemonContext* context, int verbose);
+int dlt_daemon_context_del(DltDaemon *daemon,
+ DltDaemonContext* context,
+ char *ecu,
+ int verbose);
/**
* Find context with specific application id and context id
* @param daemon pointer to dlt daemon structure
* @param apid pointer to application id
* @param ctid pointer to context id
+ * @param ecu pointer to ecu id of node to clear applications
* @param verbose if set to true verbose information is printed out.
* @return Pointer to context, null pointer on error or not found
*/
-DltDaemonContext* dlt_daemon_context_find(DltDaemon *daemon,char *apid,char *ctid,int verbose);
+DltDaemonContext* dlt_daemon_context_find(DltDaemon *daemon,
+ char *apid,
+ char *ctid,
+ char *ecu,
+ int verbose);
/**
* Invalidate all contexts fd, if fd is reused
* @param daemon pointer to dlt daemon structure
+ * @param ecu node these contexts running on.
* @param fd file descriptor
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_contexts_invalidate_fd(DltDaemon *daemon,int fd,int verbose);
+int dlt_daemon_contexts_invalidate_fd(DltDaemon *daemon,
+ char *ecu,
+ int fd,
+ int verbose);
/**
- * Clear all contexts in internal context management
+ * Clear all contexts in internal context management of specific ecu
* @param daemon pointer to dlt daemon structure
+ * @param ecu pointer to ecu id of node to clear contexts
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
-int dlt_daemon_contexts_clear(DltDaemon *daemon,int verbose);
+int dlt_daemon_contexts_clear(DltDaemon *daemon, char *ecu, int verbose);
/**
* Load contexts from file to internal context management
* @param daemon pointer to dlt daemon structure