automotive-dlt
dlt_user_shared.h
Go to the documentation of this file.
1 /*
2  * @licence app begin@
3  * SPDX license identifier: MPL-2.0
4  *
5  * Copyright (C) 2011-2015, BMW AG
6  *
7  * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
8  *
9  * This Source Code Form is subject to the terms of the
10  * Mozilla Public License (MPL), v. 2.0.
11  * If a copy of the MPL was not distributed with this file,
12  * You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  * For further information see http://www.genivi.org/.
15  * @licence end@
16  */
17 
29 /*******************************************************************************
30 ** **
31 ** SRC-MODULE: dlt_user_shared.h **
32 ** **
33 ** TARGET : linux **
34 ** **
35 ** PROJECT : DLT **
36 ** **
37 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
38 ** Markus Klein **
39 ** **
40 ** PURPOSE : **
41 ** **
42 ** REMARKS : **
43 ** **
44 ** PLATFORM DEPENDANT [yes/no]: yes **
45 ** **
46 ** TO BE CHANGED BY USER [yes/no]: no **
47 ** **
48 *******************************************************************************/
49 
50 /*******************************************************************************
51 ** Author Identity **
52 ********************************************************************************
53 ** **
54 ** Initials Name Company **
55 ** -------- ------------------------- ---------------------------------- **
56 ** aw Alexander Wenzel BMW **
57 ** mk Markus Klein Fraunhofer ESK **
58 *******************************************************************************/
59 
60 /*******************************************************************************
61 ** Author Identity **
62 ********************************************************************************
63 ** **
64 ** Initials Name Company **
65 ** -------- ------------------------- ---------------------------------- **
66 ** aw Alexander Wenzel BMW **
67 ** mk Markus Klein Fraunhofer ESK **
68 *******************************************************************************/
69 
70 #ifndef DLT_USER_SHARED_H
71 #define DLT_USER_SHARED_H
72 
73 #include "dlt_types.h"
74 #include "dlt_user.h"
75 
76 #include <sys/types.h>
77 
81 typedef struct
82 {
83  char pattern[DLT_ID_SIZE];
84  uint32_t message;
85 } PACKED DltUserHeader;
86 
90 typedef struct
91 {
92  char apid[DLT_ID_SIZE];
93  pid_t pid;
94  uint32_t description_length;
95 } PACKED DltUserControlMsgRegisterApplication;
96 
100 typedef struct
101 {
102  char apid[DLT_ID_SIZE];
103  pid_t pid;
104 } PACKED DltUserControlMsgUnregisterApplication;
105 
109 typedef struct
110 {
111  char apid[DLT_ID_SIZE];
112  char ctid[DLT_ID_SIZE];
113  int32_t log_level_pos;
114  int8_t log_level;
115  int8_t trace_status;
116  pid_t pid;
117  uint32_t description_length;
118 } PACKED DltUserControlMsgRegisterContext;
119 
123 typedef struct
124 {
125  char apid[DLT_ID_SIZE];
126  char ctid[DLT_ID_SIZE];
127  pid_t pid;
128 } PACKED DltUserControlMsgUnregisterContext;
129 
133 typedef struct
134 {
135  uint8_t log_level;
136  uint8_t trace_status;
137  int32_t log_level_pos;
138 } PACKED DltUserControlMsgLogLevel;
139 
143 typedef struct
144 {
145  int32_t log_level_pos;
146  uint32_t service_id;
148 } PACKED DltUserControlMsgInjection;
149 
154 typedef struct
155 {
156  char apid[DLT_ID_SIZE];
157  uint8_t log_level;
158  uint8_t trace_status;
159 } PACKED DltUserControlMsgAppLogLevelTraceStatus;
160 
164 typedef struct
165 {
166  int8_t log_mode;
167 } PACKED DltUserControlMsgLogMode;
168 
172 typedef struct
173 {
174  int8_t log_state;
175 } PACKED DltUserControlMsgLogState;
176 
180 typedef struct
181 {
182  uint32_t overflow_counter;
183  char apid[4];
184 } PACKED DltUserControlMsgBufferOverflow;
185 
186 /**************************************************************************************************
187 * The folowing functions are used shared between the user lib and the daemon implementation
188 **************************************************************************************************/
189 
196 DltReturnValue dlt_user_set_userheader(DltUserHeader *userheader, uint32_t mtype);
197 
203 int dlt_user_check_userheader(DltUserHeader *userheader);
204 
214 DltReturnValue dlt_user_log_out2(int handle, void *ptr1, size_t len1, void* ptr2, size_t len2);
215 
227 DltReturnValue dlt_user_log_out3(int handle, void *ptr1, size_t len1, void* ptr2, size_t len2, void *ptr3, size_t len3);
228 
229 #endif /* DLT_USER_SHARED_H */
int dlt_user_check_userheader(DltUserHeader *userheader)
int8_t log_level
#define DLT_ID_SIZE
Definition: dlt_common.h:204
int8_t log_mode
uint32_t data_length_inject
DltReturnValue
Definition: dlt_types.h:86
pid_t pid
DltReturnValue dlt_user_log_out3(int handle, void *ptr1, size_t len1, void *ptr2, size_t len2, void *ptr3, size_t len3)
int8_t trace_status
int8_t log_state
uint32_t overflow_counter
uint32_t message
static char * service_id[]
Definition: dlt_common.c:85
DltReturnValue dlt_user_log_out2(int handle, void *ptr1, size_t len1, void *ptr2, size_t len2)
uint32_t description_length
DltReturnValue dlt_user_set_userheader(DltUserHeader *userheader, uint32_t mtype)
int32_t log_level_pos