• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SERVICE_DSLM_BIGDATA_H
17 #define SERVICE_DSLM_BIGDATA_H
18 
19 #ifdef __cplusplus
20 #include <cstdint>
21 constexpr int MODEL_MAX_LEN = 128;
22 constexpr int PKG_NAME_MAX_LEN = 256;
23 #else
24 #include <stdint.h>
25 #define MODEL_MAX_LEN 128
26 #define PKG_NAME_MAX_LEN 256
27 #endif
28 
29 typedef struct AppInvokeEvent {
30     int32_t uid;
31     int32_t costTime;
32     int32_t retCode;
33     int32_t secLevel;
34     int32_t retMode;
35     char localModel[MODEL_MAX_LEN];
36     char targetModel[MODEL_MAX_LEN];
37     char pkgName[PKG_NAME_MAX_LEN];
38 } AppInvokeEvent;
39 
40 typedef struct SecurityInfoSyncEvent {
41     char localModel[MODEL_MAX_LEN];
42     char targetModel[MODEL_MAX_LEN];
43     uint64_t localVersion;
44     uint64_t targetVersion;
45     int32_t credType;
46     int32_t retCode;
47     int32_t costTime;
48     int32_t secLevel;
49 } SecurityInfoSyncEvent;
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 void ReportServiceStartFailedEvent(const uint32_t errorType);
56 
57 void ReportInitSelfFailedEvent(const char *errorString);
58 
59 void ReportAppInvokeEvent(const AppInvokeEvent *event);
60 
61 void ReportSecurityInfoSyncEvent(const SecurityInfoSyncEvent *event);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif // SERVICE_DSLM_BIGDATA_H
68