• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 TRANS_EVENT_ATOM_FORM_H
17 #define TRANS_EVENT_ATOM_FORM_H
18 
19 #include <stdint.h>
20 
21 #include "event_form_enum.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 typedef enum {
28     EVENT_SCENE_OPEN_CHANNEL = 1,
29     EVENT_SCENE_CLOSE_CHANNEL_ACTIVE = 2,
30     EVENT_SCENE_CLOSE_CHANNEL_PASSIVE = 3,
31     EVENT_SCENE_CLOSE_CHANNEL_TIMEOUT = 4,
32     EVENT_SCENE_BT_FLOW = 5,
33     EVENT_SCENE_LANE_SCORE = 6,
34     EVENT_SCENE_ACTIVATION = 7,
35     EVENT_SCENE_DETECTION = 8,
36     EVENT_SCENE_OPEN_CHANNEL_SERVER = 9,
37     EVENT_SCENE_TRANS_CREATE_SESS_SERVER = 10,
38     EVENT_SCENE_TRANS_REMOVE_SESS_SERVER = 11,
39     EVENT_SCENE_TRANS_PROXY_RESET_PEER = 12,
40     EVENT_SCENE_TRANS_CHANNEL_STATISTICS = 13,
41     EVENT_SCENE_TRANS_CHANNEL_INSTANT = 14,
42     EVENT_SCENE_TRANS_MESSAGE_PARSE = 15,
43     EVENT_SCENE_TRANS_RECEIVED_DATA = 16,
44     EVENT_SCENE_TRANS_SEND_DATA = 17,
45     EVENT_SCENE_CHANNEL_REQUEST = 18,
46     EVENT_SCENE_TRANS_RECV_STREAM = 19,
47     EVENT_SCENE_TRANS_REPORT_WIFIINFO = 20,
48     EVENT_SCENE_PAGING_CONNECT = 21,
49     EVENT_SCENE_TALKIE = 22,
50 } TransEventScene;
51 
52 typedef enum {
53     EVENT_STAGE_PAGING_START_CONNECT = 1,
54     EVENT_STAGE_PAGING_END_CONNECT = 2,
55     EVENT_STAGE_PAGING_AUTH_START = 3,
56     EVENT_STAGE_PAGING_AUTH_END = 4,
57     EVENT_STAGE_PAGING_SOURCE_HANDSHAKE_START = 5,
58     EVENT_STAGE_PAGING_SOURCE_HANDSHAKE_END = 6,
59     EVENT_STAGE_PAGING_SINK_HANDSHAKE_START = 7,
60     EVENT_STAGE_PAGING_SINK_HANDSHAKE_END = 8,
61 } TransEventPagingChannelStage;
62 
63 typedef enum {
64     EVENT_STAGE_TALKIE_BROADCAST_SEND = 1,
65     EVENT_STAGE_TALKIE_BROADCAST_STOP = 2,
66     EVENT_STAGE_TALKIE_BROADCAST_RECV = 3,
67     EVENT_STAGE_TALKIE_PULL_UP_START = 4,
68     EVENT_STAGE_TALKIE_PULL_UP_END = 5,
69 } TransEventTalkieStage;
70 
71 typedef enum {
72     EVENT_STAGE_OPEN_CHANNEL_START = 1,
73     EVENT_STAGE_SELECT_LANE = 2,
74     EVENT_STAGE_START_CONNECT = 3,
75     EVENT_STAGE_HANDSHAKE_START = 4,
76     EVENT_STAGE_HANDSHAKE_REPLY = 5,
77     EVENT_STAGE_OPEN_CHANNEL_END = 6,
78 } TransEventOpenChannelStage;
79 
80 typedef enum {
81     EVENT_STAGE_CLOSE_CHANNEL = 1,
82 } TransEventCloseChannelStage;
83 
84 typedef enum {
85     EVENT_STAGE_TRANS_COMMON_ONE = 1,
86 } TransEventCommonStage;
87 
88 typedef enum {
89     EVENT_STAGE_TRANS_RECV_STREAM = 1,
90 } TransEventStreamStage;
91 
92 typedef enum {
93     DEVICE_STATE_INVALID = 1,
94     DEVICE_STATE_LOCAL_BT_HALF_OFF,
95     DEVICE_STATE_REMOTE_BT_HALF_OFF,
96     DEVICE_STATE_LOCAL_WIFI_HALF_OFF,
97     DEVICE_STATE_REMOTE_WIFI_HALF_OFF,
98     DEVICE_STATE_NOT_CARE,
99     DEVICE_STATE_BUTT,
100 } TransDeviceState;
101 
102 typedef struct {
103     uint8_t talkieFreq;        // TALKIE_FREQ
104     uint8_t talkieType;        // TALKIE_TYPE
105     uint8_t talkieLevel;       // TALKIE_LEVEL
106     int32_t result;            // STAGE_RES
107     int32_t errcode;           // ERROR_CODE
108     const char *socketName;    // SESSION_NAME
109     int32_t dataType;          // DATA_TYPE
110     int32_t channelType;       // LOGIC_CHAN_TYPE
111     int32_t laneId;            // LANE_ID
112     int32_t preferLinkType;    // PREFER_LINK_TYPE
113     int32_t laneTransType;     // LANE_TRANS_TYPE
114     int32_t channelId;         // CHAN_ID
115     int32_t requestId;         // REQ_ID
116     int32_t connectionId;      // CONN_ID
117     int32_t linkType;          // LINK_TYPE
118     int32_t authId;            // AUTH_ID
119     int32_t socketFd;          // SOCKET_FD
120     int32_t costTime;          // TIME_CONSUMING
121     int32_t channelScore;      // CHAN_SCORE
122     int32_t peerChannelId;     // PEER_CHAN_ID
123     int32_t btFlow;            // BT_FLOW
124     int32_t pagingId;          // PAGING_ID
125     int32_t callPid;         // CALLER_PID
126     int32_t saId;              // SA_ID
127     int32_t businessFlag;      // BUSINESS_FLAG
128     const char *groupId;    // GROUP_ID
129     const char *subGroupId; // SUB_GROUP_ID
130     const char *peerNetworkId; // PEER_NET_ID
131     const char *peerUdid;      // PEER_UDID
132     const char *peerDevVer;    // PEER_DEV_VER
133     const char *localUdid;     // LOCAL_UDID
134     const char *callerPkg;     // HOST_PKG
135     const char *calleePkg;     // TO_CALL_PKG
136     const char *firstTokenName; // FIRST_TOKEN_NAME
137     const char *callerAccountId; //CALLER_ACCOUNT_ID
138     const char *calleeAccountId; //CALLEE_ACCOUNT_ID
139     uint64_t firstTokenId;     // FIRST_TOKEN_ID
140     int32_t  firstTokenType;   // FIRST_TOKEN_TYPE
141     const char *trafficStats;  // TRAFFIC_STATS
142     int32_t  osType;           // OS_TYPE
143     int32_t  deviceState;      // DEVICE_STATE
144     int32_t businessId;        // BUSINESS_ID
145     int32_t businessType;      // BUSINESS_TYPE
146     int32_t sessionId;         // SESSION_ID
147     int32_t minBW;             // MIN_BW
148     int32_t maxLatency;        // MAX_LATENCY
149     int32_t minLatency;        // MIN_LATENCY
150     uint8_t localStaChload;    // LOCAL_STA_CHLOAD
151     uint8_t remoteStaChload;   // REMOTE_STA_CHLOAD
152     uint8_t localHmlChload;    // LOCAL_HML_CHLOAD
153     uint8_t remoteHmlChload;   // REMOTE_HML_CHLOAD
154     uint8_t localP2pChload;    // LOCAL_P2P_CHLOAD
155     uint8_t remoteP2pChload;   // REMOTE_P2P_CHLOAD
156     uint8_t localStaChannel;   // LOCAL_STA_CHANNEL
157     uint8_t remoteStaChannel;  // REMOTE_STA_CHANNEL
158     uint8_t hmlChannel;        // HML_CHANNEL
159     uint8_t localP2pChannel;   // LOCAL_P2P_CHANNEL
160     uint8_t remoteP2pChannel;  // REMOTE_P2P_CHANNEL
161     int32_t localIsDbac;       // LOCAL_IS_DBAC
162     int32_t remoteIsDbac;      // REMOTE_IS_DBAC
163     int32_t localIsDbdc;       // LOCAL_IS_DBDC
164     int32_t remoteIsDbdc;      // REMOTE_IS_DBDC
165     const char *conCurrentId;  // CONCURRENT_ID
166 } TransEventExtra;
167 
168 typedef enum {
169     ALARM_SCENE_TRANS_RESERVED = 1,
170 } TransAlarmScene;
171 
172 typedef struct {
173     int32_t errcode;
174     int32_t result;
175     int32_t callerPid;
176     int32_t linkType;
177     int32_t minBw;
178     int32_t methodId;
179     int32_t duration;
180     int32_t curFlow;
181     int32_t limitFlow;
182     int32_t limitTime;
183     int32_t occupyRes;
184     int32_t syncType;
185     int32_t syncData;
186     int32_t retryCount;
187     int32_t retryReason;
188     const char *conflictName;
189     const char *conflictedName;
190     const char *occupyedName;
191     const char *permissionName;
192     const char *sessionName;
193 } TransAlarmExtra;
194 
195 typedef enum {
196     STATS_SCENE_TRANS_RESERVED = 1,
197 } TransStatsScene;
198 
199 typedef struct {
200     int32_t reserved;
201 } TransStatsExtra;
202 
203 typedef enum {
204     AUDIT_SCENE_OPEN_SESSION = 1,
205     AUDIT_SCENE_SEND_FILE,
206     AUDIT_SCENE_SEND_BYTES,
207     AUDIT_SCENE_SEND_MSG,
208     AUDIT_SCENE_SEND_STREAM,
209 } TransAuditScene;
210 
211 typedef enum {
212     TRANS_AUDIT_CONTINUE = 1,
213     TRANS_AUDIT_DISCONTINUE,
214     TRANS_AUDIT_TRY_AGAIN,
215 } TransAuditResult;
216 
217 typedef struct {
218     const char *hostPkg;         // HOST_PKG
219     int32_t result;              // RESULT
220     int32_t errcode;             // ERROR_CODE
221     SoftbusAuditType auditType;  // AUDIT_TYPE
222     const char *localIp;         // LOCAL_IP
223     const char *localPort;       // LOCAL_PORT
224     const char *localDevId;      // LOCAL_DEV_ID
225     int32_t localDevType;        // LOCAL_DEV_TYPE
226     const char *localSessName;   // LOCAL_SESS_NAME
227     int32_t localChannelId;      // LOCAL_CHANNEL_ID
228     const char *peerIp;          // PEER_IP
229     const char *peerPort;        // PEER_PORT
230     const char *peerDevId;       // PEER_DEV_ID
231     int32_t peerDevType;         // PEER_DEV_TYPE
232     const char *peerSessName;    // PEER_SESS_NAME
233     int32_t peerChannelId;       // PEER_CHANNEL_ID
234     int32_t channelType;         // LOGIC_CHAN_TYPE
235     int32_t authId;              // AUTH_ID
236     int32_t reqId;               // REQ_ID
237     int32_t linkType;            // LINK_TYPE
238     int32_t connId;              // CONN_ID
239     int32_t socketFd;            // SOCKET_FD
240     int32_t dataType;            // DATA_TYPE
241     int32_t dataLen;             // DATA_LENGTH
242     int32_t dataSeq;             // DATA_SEQ
243     int32_t costTime;            // TIME_CONSUMING
244     int32_t dataTraffic;         // DATA_TRAFFIC
245     int32_t reqCount;            // REQ_COUNT
246 } TransAuditExtra;
247 
248 #ifdef __cplusplus
249 }
250 #endif /* __cplusplus */
251 #endif // TRANS_EVENT_ATOM_FORM_H
252