210de3c6fb2a329a033d96cea6d341d2e538ba63
[profile/ivi/dlt-daemon.git] / src / system / dlt-system.h
1 /*
2  * Dlt system manager to Dlt
3  * @licence app begin@
4  *
5  * Copyright (C) 2011, BMW AG - Alexander Wenzel <alexander.wenzel@bmw.de>
6  * 
7  * This program is free software; you can redistribute it and/or modify it under the terms of the 
8  * GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even 
10  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General 
11  * Public License, version 2.1, for more details.
12  * 
13  * You should have received a copy of the GNU Lesser General Public License, version 2.1, along 
14  * with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
15  * 
16  * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may 
17  * also be applicable to programs even in cases in which the program is not a library in the technical sense.
18  * 
19  * Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may 
20  * license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to 
21  * license your linked modules under the GNU Lesser General Public License, version 2.1, you 
22  * may use the program under the following exception.
23  * 
24  * As a special exception, the copyright holders of DLT give you permission to combine DLT 
25  * with software programs or libraries that are released under any license unless such a combination is not
26  * permitted by the license of such a software program or library. You may copy and distribute such a 
27  * system following the terms of the GNU Lesser General Public License, version 2.1, including this
28  * special exception, for DLT and the licenses of the other code concerned.
29  * 
30  * Note that people who make modified versions of DLT are not obligated to grant this special exception 
31  * for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, 
32  * version 2.1, gives permission to release a modified version without this exception; this exception 
33  * also makes it possible to release a modified version which carries forward this exception.
34  *
35  * @licence end@
36  */
37
38 /*******************************************************************************
39 **                                                                            **
40 **  SRC-MODULE: dlt-system.h                                                  **
41 **                                                                            **
42 **  TARGET    : linux                                                         **
43 **                                                                            **
44 **  PROJECT   : DLT                                                           **
45 **                                                                            **
46 **  AUTHOR    : Alexander Wenzel Alexander.AW.Wenzel@bmw.de                   **
47 **                                                                            **
48 **  PURPOSE   :                                                               **
49 **                                                                            **
50 **  REMARKS   :                                                               **
51 **                                                                            **
52 **  PLATFORM DEPENDANT [yes/no]: yes                                          **
53 **                                                                            **
54 **  TO BE CHANGED BY USER [yes/no]: no                                        **
55 **                                                                            **
56 *******************************************************************************/
57
58 /*******************************************************************************
59 **                      Author Identity                                       **
60 ********************************************************************************
61 **                                                                            **
62 ** Initials     Name                       Company                            **
63 ** --------     -------------------------  ---------------------------------- **
64 **  aw          Alexander Wenzel           BMW                                **
65 *******************************************************************************/
66
67 /*******************************************************************************
68 **                      Revision Control History                              **
69 *******************************************************************************/
70
71 #ifndef DLT_SYSTEM_H
72 #define DLT_SYSTEM_H
73
74 #define DLT_SYSTEM_MODE_OFF 0
75 #define DLT_SYSTEM_MODE_STARTUP 1
76 #define DLT_SYSTEM_MODE_REGULAR 2
77
78 #define DLT_SYSTEM_LOG_FILE_MAX 32
79 #define DLT_SYSTEM_LOG_PROCESSES_MAX 32
80
81 typedef struct {
82         char ConfigurationFile[256];
83         char ApplicationId[256];
84         int  daemonise;
85
86         int  SyslogEnable;                                      /*# Enable the Syslog Adapter (Default: 0)*/
87         char SyslogContextId[256];                      /*# The Context Id of the syslog adapter (Default: SYSL)*/
88         int  SyslogPort;                                        /*# The UDP port opened by DLT system mamager to receive system logs (Default: 47111)*/
89         
90         int  FiletransferEnable;                        /*# Enable the Filetransfer (Default: 0)*/
91         char FiletransferDirectory1[256];       /*# Directory which contains files to be transfered over DLT (Default: /tmp/filetransfer)# Files are deleted after Filetransfer is finished and after TimeDelay expired*/
92         char FiletransferDirectory2[256];
93         char FiletransferContextId[256];        /*# The Context Id of the filetransfer (Default: FILE)*/
94         int  FiletransferTimeStartup;           /*# Time after startup of dlt-system when first file is transfered (Default: 30)# Time in seconds*/
95         int  FiletransferTimeDelay;                     /*# Time to wait when transfered file is deleted and next file transfer starts (Default: 10)# Time in seconds*/
96         int  FiletransferTimeoutBetweenLogs;/*# Waits a period of time between two file transfer logs of a single file to DLT to ensure that the FIFO of DLT is not flooded.*/
97
98         /*# Log different files
99         # Mode: 0 = off, 1 = startup only, 2 = regular
100         # TimeDelay: If mode regular is set, time delay is the number of seconds for next sent
101         */
102         int  LogFileEnable;                                     /*# Enable the logging of files (Default: 0)*/
103         int  LogFileNumber;
104         char LogFileFilename[DLT_SYSTEM_LOG_FILE_MAX][256];
105         int  LogFileMode[DLT_SYSTEM_LOG_FILE_MAX];
106         int  LogFileTimeDelay[DLT_SYSTEM_LOG_FILE_MAX];
107         char LogFileContextId[DLT_SYSTEM_LOG_FILE_MAX][256];
108
109         int  LogProcessesEnable;                        /*# Enable the logging of processes (Default: 0)*/
110         char LogProcessesContextId[256];        /*# The Context Id of the kernel version (Default: PROC)*/
111
112         /*# Log different processes
113         # Name: * = all process, X=alternative name (must correspind to /proc/X/cmdline
114         # Filename: the filename in the subdirectory /proc/processid/
115         # Mode: 0 = off, 1 = startup only, 2 = regular
116         # TimeDelay: If mode regular is set, time delay is the number of seconds for next sent
117         */
118         int  LogProcessNumber;
119         char LogProcessName[DLT_SYSTEM_LOG_PROCESSES_MAX][256];
120         char LogProcessFilename[DLT_SYSTEM_LOG_PROCESSES_MAX][256];
121         int  LogProcessMode[DLT_SYSTEM_LOG_PROCESSES_MAX];
122         int  LogProcessTimeDelay[DLT_SYSTEM_LOG_PROCESSES_MAX];
123 } DltSystemOptions;
124
125 typedef struct {
126         int  timeStartup;       /* time in seconds since startup of dlt-system */
127         int  timeFiletransferDelay;     /* time in seconds to start next filetransfer */
128         char filetransferFile[256];
129         long int filetransferFilesize;
130         int  timeLogFileDelay[DLT_SYSTEM_LOG_FILE_MAX]; /* time in seconds to start next file log */
131         int  timeLogProcessDelay[DLT_SYSTEM_LOG_PROCESSES_MAX]; /* time in seconds to start next process log */
132         int      filetransferRunning;   /* 0 = stooped, 1 = running */
133         int  filetransferCountPackages; /* number of packets to be transfered */
134         int  filetransferLastSentPackage; /* last packet sent starting from 1 */
135 } DltSystemRuntime;
136
137 #endif /* DLT_SYSTEM_H */