automotive-dlt
|
#include <errno.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "dlt_common.h"
#include "dlt_protocol.h"
#include "dlt_client.h"
#include "dlt-control-common.h"
#include "dlt-logstorage-common.h"
#include "dlt-logstorage-prop.h"
Go to the source code of this file.
Data Structures | |
struct | LogstorageOptions |
Macros | |
#define | pr_fmt(fmt) "Logstorage common: "fmt |
Functions | |
DltLogstorageHandler | get_handler_type (void) |
void | set_handler_type (char *type) |
int | get_default_event_type (void) |
void | set_default_event_type (long type) |
char * | get_default_path (void) |
void | set_default_path (char *path) |
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) |
Initialized the handler based on configuration. More... | |
int | dlt_logstorage_deinit_handler (void) |
Clean-up the handler based on configuration. More... | |
int | dlt_logstorage_check_config_file (char *mnt_point) |
Search for config file in given mount point. More... | |
int | dlt_logstorage_check_directory_permission (char *mnt_point) |
Check if given mount point is writable. More... | |
static DltControlMsgBody * | prepare_message_body (DltControlMsgBody **body, int conn_type, char *path) |
Prepares the body of the message to be send to DLT. More... | |
int | dlt_logstorage_send_event (int type, char *mount_point) |
Send a logstorage event to DLT. More... | |
Variables | |
static struct LogstorageOptions | g_options |
static DltLogstorageCtrl | lctrl |
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.
For further information see http://www.genivi.org/. end@
Definition in file dlt-logstorage-common.c.
#define pr_fmt | ( | fmt | ) | "Logstorage common: "fmt |
Definition at line 54 of file dlt-logstorage-common.c.
int dlt_logstorage_check_config_file | ( | char * | mnt_point | ) |
Search for config file in given mount point.
The file is searched at the top directory. The function exits once it founds it.
mnt_point | The mount point to check |
Definition at line 196 of file dlt-logstorage-common.c.
References CONF_NAME, NULL, pr_error, and pr_verbose.
Referenced by check_mountpoint_from_partition(), and dlt_logstorage_ctrl_single_request().
int dlt_logstorage_check_directory_permission | ( | char * | mnt_point | ) |
Check if given mount point is writable.
mnt_point | The mount point to check |
Definition at line 248 of file dlt-logstorage-common.c.
References NULL, and pr_error.
Referenced by dlt_logstorage_ctrl_single_request().
int dlt_logstorage_deinit_handler | ( | void | ) |
Clean-up the handler based on configuration.
Definition at line 171 of file dlt-logstorage-common.c.
References CTRL_PROPRIETARY, CTRL_UDEV, dlt_logstorage_prop_deinit(), dlt_logstorage_udev_deinit(), and get_handler_type().
Referenced by dlt_logstorage_ctrl_setup_event_loop().
void* dlt_logstorage_get_handler_cb | ( | void | ) |
Definition at line 137 of file dlt-logstorage-common.c.
References DltLogstorageCtrl::callback.
Referenced by dlt_logstorage_ctrl_setup_event_loop().
int dlt_logstorage_get_handler_fd | ( | void | ) |
Definition at line 142 of file dlt-logstorage-common.c.
References DltLogstorageCtrl::fd.
Referenced by dlt_logstorage_ctrl_setup_event_loop().
int dlt_logstorage_init_handler | ( | void | ) |
Initialized the handler based on configuration.
Definition at line 151 of file dlt-logstorage-common.c.
References CTRL_PROPRIETARY, CTRL_UDEV, dlt_logstorage_prop_init(), dlt_logstorage_udev_init(), and get_handler_type().
Referenced by dlt_logstorage_ctrl_setup_event_loop().
int dlt_logstorage_send_event | ( | int | type, |
char * | mount_point | ||
) |
Send a logstorage event to DLT.
type | The type of the event (Mounted/Unmounting) |
mount_point | The mount point for this event |
Definition at line 327 of file dlt-logstorage-common.c.
References DltControlMsgBody::data, dlt_control_send_message(), get_timeout(), NULL, pr_error, and prepare_message_body().
Referenced by check_mountpoint_from_partition(), and dlt_logstorage_ctrl_single_request().
int get_default_event_type | ( | void | ) |
Definition at line 104 of file dlt-logstorage-common.c.
References LogstorageOptions::event_type, and g_options.
Referenced by dlt_logstorage_ctrl_single_request(), and parse_args().
char* get_default_path | ( | void | ) |
Definition at line 114 of file dlt-logstorage-common.c.
References LogstorageOptions::device_path, and g_options.
Referenced by dlt_logstorage_ctrl_single_request().
DltLogstorageHandler get_handler_type | ( | void | ) |
Definition at line 89 of file dlt-logstorage-common.c.
References g_options, and LogstorageOptions::handler_type.
Referenced by dlt_logstorage_deinit_handler(), dlt_logstorage_init_handler(), main(), and parse_args().
DltLogstorageCtrl* get_logstorage_control | ( | void | ) |
Definition at line 132 of file dlt-logstorage-common.c.
References lctrl.
Referenced by dlt_logstorage_udev_deinit(), dlt_logstorage_udev_init(), and logstorage_udev_udevd_callback().
|
static |
Prepares the body of the message to be send to DLT.
body | A pointer to the MsgBody structure pointer |
conn_type | The type of the event (Mounted/Unmounting) |
path | The mount point path. |
Definition at line 272 of file dlt-logstorage-common.c.
References DltControlMsgBody::data, DLT_MOUNT_PATH_MAX, DLT_SERVICE_ID_OFFLINE_LOGSTORAGE, NULL, pr_error, and pr_verbose.
Referenced by dlt_logstorage_send_event().
void set_default_event_type | ( | long | type | ) |
Definition at line 109 of file dlt-logstorage-common.c.
References LogstorageOptions::event_type, and g_options.
Referenced by parse_args().
void set_default_path | ( | char * | path | ) |
Definition at line 119 of file dlt-logstorage-common.c.
References LogstorageOptions::device_path, DLT_MOUNT_PATH_MAX, g_options, and NULL.
Referenced by parse_args().
void set_handler_type | ( | char * | type | ) |
Definition at line 94 of file dlt-logstorage-common.c.
References check_proprietary_handling(), CTRL_PROPRIETARY, CTRL_UDEV, g_options, and LogstorageOptions::handler_type.
Referenced by parse_args().
|
static |
Referenced by get_default_event_type(), get_default_path(), get_handler_type(), set_default_event_type(), set_default_path(), and set_handler_type().
|
static |
Definition at line 130 of file dlt-logstorage-common.c.
Referenced by dlt_logstorage_udev_deinit(), dlt_logstorage_udev_init(), get_logstorage_control(), and logstorage_udev_udevd_callback().