1 /*
2  * Copyright (c) 2023 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 SOFTBUS_EVENT_FORM_H
17 #define SOFTBUS_EVENT_FORM_H
18 
19 #include "form/conn_event_form.h"
20 #include "form/disc_event_form.h"
21 #include "form/lnn_event_form.h"
22 #include "form/trans_event_form.h"
23 #include "form/stats_event_form.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define SOFTBUS_EVENT_DOMAIN        "DSOFTBUS"
30 #define SOFTBUS_EVENT_PKG_NAME      "dsoftbus"
31 #define SOFTBUS_EVENT_TYPE_BEHAVIOR 4
32 #define SOFTBUS_EVENT_TYPE_SECURITY 3
33 
34 typedef struct {
35     int32_t scene;     // BIZ_SCENE
36     int32_t stage;     // BIZ_STAGE
37     int32_t eventType; // EVENT_TYPE
38     int32_t line;      // CODE_LINE
39     const char *domain;    // DOMAIN
40     const char *eventName; // EVENT_NAME
41     const char *orgPkg;    // ORG_PKG
42     const char *func;      // FUNC
43     union {
44         ConnEventExtra *connExtra;
45         DiscEventExtra *discExtra;
46         LnnEventExtra *lnnExtra;
47         TransEventExtra *transExtra;
48         StatsEventExtra *statsExtra;
49         TransAlarmExtra *transAlarmExtra;
50         ConnAlarmExtra *connAlarmExtra;
51         LnnAlarmExtra *lnnAlarmExtra;
52         DiscAlarmExtra *discAlarmExtra;
53         ConnAuditExtra *connAuditExtra;
54         DiscAuditExtra *discAuditExtra;
55         LnnAuditExtra *lnnAuditExtra;
56         TransAuditExtra *transAuditExtra;
57     };
58 } SoftbusEventForm;
59 
60 #ifdef __cplusplus
61 }
62 #endif /* __cplusplus */
63 #endif // SOFTBUS_EVENT_FORM_H
64