summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_offline_logstorage.c
diff options
context:
space:
mode:
authorChristoph Lipka <clipka@jp.adit-jv.com>2015-11-13 14:45:10 +0900
committerLutz Helwing <lutz_helwing@mentor.com>2015-12-07 10:07:26 +0100
commit1e697cc45d8771fe15e6271ac722798f2a90d048 (patch)
tree924740aefdf12e857ea2016895d8191b8be440ac /src/daemon/dlt_daemon_offline_logstorage.c
parent5acb7dd008a57f6da3bf7b9cf85cfc2c86cac151 (diff)
downloadDLT-daemon-1e697cc45d8771fe15e6271ac722798f2a90d048.tar.gz
MultiNode: Logstorage: ECUid as filter attribute
This patch enables the user to specify the ECU identifier as another filter attribute for a Logstorage filter configuration. This attribute is optional. If not specified, the ECUid will not be checked during message filtering within the Logstorage component. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Diffstat (limited to 'src/daemon/dlt_daemon_offline_logstorage.c')
-rw-r--r--src/daemon/dlt_daemon_offline_logstorage.c64
1 files changed, 34 insertions, 30 deletions
diff --git a/src/daemon/dlt_daemon_offline_logstorage.c b/src/daemon/dlt_daemon_offline_logstorage.c
index 66f9ec8..cd0ee11 100644
--- a/src/daemon/dlt_daemon_offline_logstorage.c
+++ b/src/daemon/dlt_daemon_offline_logstorage.c
@@ -466,7 +466,7 @@ int dlt_daemon_logstorage_get_loglevel(DltDaemon *daemon, int max_device, char *
* to write to the device, DltDaemon will disconnect this device.
*
* @param daemon Pointer to Dlt Daemon structure
- * @param user_config User configurations for log file
+ * @param user_config DltDaemon configuration
* @param data1 message header buffer
* @param size1 message header buffer size
* @param data2 message extended header buffer
@@ -474,51 +474,55 @@ int dlt_daemon_logstorage_get_loglevel(DltDaemon *daemon, int max_device, char *
* @param data3 message data buffer
* @param size3 message data size
*/
-void dlt_daemon_logstorage_write(DltDaemon *daemon, DltDaemonFlags user_config,
- unsigned char *data1, int size1, unsigned char *data2, int size2,
- unsigned char *data3, int size3)
+void dlt_daemon_logstorage_write(DltDaemon *daemon,
+ DltDaemonFlags *user_config,
+ unsigned char *data1,
+ int size1,
+ unsigned char *data2,
+ int size2,
+ unsigned char *data3,
+ int size3)
{
int i = 0;
-
- /* data2 contains DltStandardHeader, DltStandardHeaderExtra and DltExtendedHeader. We are interested
- * in last one, because it contains apid, ctid and loglevel */
- DltExtendedHeader ext;
DltLogStorageUserConfig file_config;
- char apid[DLT_ID_SIZE] = {0};
- char ctid[DLT_ID_SIZE] = {0};
- int log_level = -1;
- if (daemon == NULL || user_config.offlineLogstorageMaxDevices <= 0
+ if (daemon == NULL || (user_config->offlineLogstorageMaxDevices <= 0)
|| data1 == NULL || data2 == NULL || data3 == NULL
|| ((unsigned int)size2 < (sizeof(DltStandardHeader) +
sizeof(DltStandardHeaderExtra) + sizeof(DltExtendedHeader))))
{
- dlt_log(LOG_DEBUG, "dlt_daemon_logstorage_write: message type is not log. Skip storing.\n");
+ dlt_log(LOG_INFO,
+ "dlt_daemon_logstorage_write: message type is not log. "
+ "Skip storing.\n");
return;
}
- memset(&ext, 0, sizeof(DltExtendedHeader));
- memcpy(&ext, data2 + sizeof(DltStandardHeader) + sizeof(DltStandardHeaderExtra), sizeof(DltExtendedHeader));
-
- dlt_set_id(apid, ext.apid);
- dlt_set_id(ctid, ext.ctid);
- log_level = DLT_GET_MSIN_MTIN(ext.msin);
-
/* Copy user configuration */
- file_config.logfile_timestamp = user_config.offlineLogstorageTimestamp;
- file_config.logfile_delimiter = user_config.offlineLogstorageDelimiter;
- file_config.logfile_maxcounter = user_config.offlineLogstorageMaxCounter;
- file_config.logfile_counteridxlen = user_config.offlineLogstorageMaxCounterIdx;
+ file_config.logfile_timestamp = user_config->offlineLogstorageTimestamp;
+ file_config.logfile_delimiter = user_config->offlineLogstorageDelimiter;
+ file_config.logfile_maxcounter = user_config->offlineLogstorageMaxCounter;
+ file_config.logfile_counteridxlen =
+ user_config->offlineLogstorageMaxCounterIdx;
- for (i = 0; i < user_config.offlineLogstorageMaxDevices; i++)
+ for (i = 0; i < user_config->offlineLogstorageMaxDevices; i++)
{
- if (daemon->storage_handle[i].config_status == DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE)
+ if (daemon->storage_handle[i].config_status ==
+ DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE)
{
- if (dlt_logstorage_write(&(daemon->storage_handle[i]), file_config, apid, ctid,
- log_level, data1, size1, data2, size2, data3, size3) != 0)
+ if (dlt_logstorage_write(&(daemon->storage_handle[i]),
+ &file_config,
+ data1,
+ size1,
+ data2,
+ size2,
+ data3,
+ size3) != 0)
{
- dlt_log(LOG_ERR,"dlt_daemon_logstorage_write: dlt_logstorage_write failed. Disable storage device\n");
- /* DLT_OFFLINE_LOGSTORAGE_MAX_WRITE_ERRORS happened, therefore remove logstorage device */
+ dlt_log(LOG_ERR,
+ "dlt_daemon_logstorage_write: failed. "
+ "Disable storage device\n");
+ /* DLT_OFFLINE_LOGSTORAGE_MAX_WRITE_ERRORS happened,
+ * therefore remove logstorage device */
dlt_logstorage_device_disconnected(&(daemon->storage_handle[i]));
}
}