summaryrefslogtreecommitdiff
path: root/src/console/logstorage/dlt-logstorage-common.h
diff options
context:
space:
mode:
authorFrederic Berat <fberat@de.adit-jv.com>2015-10-07 19:35:25 +0900
committerLutz Helwing <lutz_helwing@mentor.com>2015-11-24 09:48:42 +0100
commit5574d46a4083d783a915688e0e05593b9558497b (patch)
tree27284c79587b1576703424fb68d71e09d552b259 /src/console/logstorage/dlt-logstorage-common.h
parent8ed28dc15429a736c8404d491ed73fd0b04235e2 (diff)
downloadDLT-daemon-5574d46a4083d783a915688e0e05593b9558497b.tar.gz
Control application: Control appliction to support offline log storage trigger
Features : 1. One shot trigger with path 2. Automounter based trigger 3. Udev based trigger Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: anitha.ba <anithaammaji.baggam@in.bosch.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
Diffstat (limited to 'src/console/logstorage/dlt-logstorage-common.h')
-rw-r--r--src/console/logstorage/dlt-logstorage-common.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/console/logstorage/dlt-logstorage-common.h b/src/console/logstorage/dlt-logstorage-common.h
new file mode 100644
index 0000000..712f2e3
--- /dev/null
+++ b/src/console/logstorage/dlt-logstorage-common.h
@@ -0,0 +1,83 @@
+/**
+ * @licence app begin@
+ * Copyright (C) 2013 - 2015 Advanced Driver Information Technology.
+ * This code is developed by Advanced Driver Information Technology.
+ * Copyright of Advanced Driver Information Technology, Bosch and DENSO.
+ *
+ * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
+ *
+ *
+ * \copyright
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ *
+ * \author Syed Hameed <shameed@jp.adit-jv.com> ADIT 2013 - 2015
+ * \author Christoph Lipka <clipka@jp.adit-jv.com> ADIT 2015
+ * \author Frederic Berat <fberat@de.adit-jv.com> ADIT 2015
+ *
+ * \file dlt-logstorage-common.h
+ * For further information see http://www.genivi.org/.
+ * @licence end@
+ */
+
+#ifndef _DLT_LOGSTORAGE_COMMON_H_
+#define _DLT_LOGSTORAGE_COMMON_H_
+
+#define CONF_NAME "dlt_logstorage.conf"
+
+#define EVENT_UNMOUNTING 0
+#define EVENT_MOUNTED 1
+
+typedef enum
+{
+ CTRL_NOHANDLER = 0, /**< one shot application */
+ CTRL_UDEV, /**< Handles udev events */
+ CTRL_PROPRIETARY /**< Handles proprietary event */
+} DltLogstorageHandler;
+
+DltLogstorageHandler get_handler_type(void);
+void set_handler_type(char *);
+
+char *get_default_path(void);
+void set_default_path(char *);
+
+int get_default_event_type(void);
+void set_default_event_type(long type);
+
+typedef struct {
+ int fd;
+ int (*callback)(void); /* callback for event handling */
+ void *prvt; /* Private data */
+} DltLogstorageCtrl;
+
+/* Get a reference to the logstorage control instance */
+DltLogstorageCtrl *get_logstorage_control(void);
+void *dlt_logstorage_get_handler_cb(void);
+int dlt_logstorage_get_handler_fd(void);
+int dlt_logstorage_init_handler(void);
+int dlt_logstorage_deinit_handler(void);
+
+/**
+ * Send an event to the dlt daemon
+ *
+ * @param type Event type (EVENT_UNMOUNTING/EVENT_MOUNTED)
+ * @param mount_point The mount point path concerned by this event
+ *
+ * @return 0 on success, -1 on error
+ */
+int dlt_logstorage_send_event(int, char *);
+
+/** @brief Search for config file in given mount point
+ *
+ * The file is searched at the top directory. The function exits once it
+ * founds it.
+ *
+ * @param mnt_point The mount point to check
+ *
+ * @return 1 if the file is found, 0 otherwise.
+ */
+int dlt_logstorage_check_config_file(char *);
+
+#endif