automotive-dlt
dlt-logstorage-common.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DltLogstorageCtrl
 

Macros

#define CONF_NAME   "dlt_logstorage.conf"
 
#define EVENT_UNMOUNTING   0
 
#define EVENT_MOUNTED   1
 
#define EVENT_SYNC_CACHE   2
 

Enumerations

enum  DltLogstorageHandler { CTRL_NOHANDLER = 0, CTRL_UDEV, CTRL_PROPRIETARY }
 

Functions

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)
 
DltLogstorageCtrlget_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_send_event (int, char *)
 Send a logstorage event to DLT. More...
 
int dlt_logstorage_check_config_file (char *)
 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...
 

Detailed Description

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.

Author
Syed Hameed shame.nosp@m.ed@j.nosp@m.p.adi.nosp@m.t-jv.nosp@m..com ADIT 2013 - 2015
Christoph Lipka clipk.nosp@m.a@jp.nosp@m..adit.nosp@m.-jv..nosp@m.com ADIT 2015
Frederic Berat fbera.nosp@m.t@de.nosp@m..adit.nosp@m.-jv..nosp@m.com ADIT 2015

For further information see http://www.genivi.org/. end@

Definition in file dlt-logstorage-common.h.

Macro Definition Documentation

#define CONF_NAME   "dlt_logstorage.conf"
#define EVENT_MOUNTED   1
#define EVENT_SYNC_CACHE   2

Definition at line 32 of file dlt-logstorage-common.h.

Referenced by dlt_logstorage_ctrl_single_request(), and parse_args().

#define EVENT_UNMOUNTING   0

Definition at line 30 of file dlt-logstorage-common.h.

Referenced by logstorage_udev_udevd_callback().

Enumeration Type Documentation

Enumerator
CTRL_NOHANDLER 

one shot application

CTRL_UDEV 

Handles udev events

CTRL_PROPRIETARY 

Handles proprietary event

Definition at line 34 of file dlt-logstorage-common.h.

Function Documentation

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.

Parameters
mnt_pointThe mount point to check
Returns
1 if the file is found, 0 otherwise.

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.

Parameters
mnt_pointThe mount point to check
Returns
1 if the file is writable, 0 otherwise.

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.

Returns
0 on success, -1 otherwise.

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  )
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.

Returns
0 on success, -1 otherwise.

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.

Send an event to the dlt daemon

Parameters
typeEvent type (EVENT_UNMOUNTING/EVENT_MOUNTED)
mount_pointThe mount point path concerned by this event
Returns
0 on success, -1 on error
Parameters
typeThe type of the event (Mounted/Unmounting)
mount_pointThe mount point for this event
Returns
0 On success, -1 otherwise.

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  )
char* get_default_path ( void  )
DltLogstorageCtrl* get_logstorage_control ( void  )
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 *  )

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 *  )