• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025-2025 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 COMMUNICATIONNETSTACK_I_NETSTACK_CHR_CLIENT_H
17 #define COMMUNICATIONNETSTACK_I_NETSTACK_CHR_CLIENT_H
18 
19 #include <cstdint>
20 #include <string>
21 #include "curl/curl.h"
22 
23 namespace OHOS::NetStack::ChrClient {
24 
25 typedef struct DataTransHttpInfo {
26     int uid;
27     long responseCode;
28     curl_off_t totalTime;
29     curl_off_t nameLookUpTime;
30     curl_off_t connectTime;
31     curl_off_t preTransferTime;
32     curl_off_t sizeUpload;
33     curl_off_t sizeDownload;
34     curl_off_t speedDownload;
35     curl_off_t speedUpload;
36     std::string effectiveMethod;
37     curl_off_t startTransferTime;
38     std::string contentType;
39     curl_off_t redirectTime;
40     long redirectCount;
41     long osError;
42     long sslVerifyResult;
43     curl_off_t appconnectTime;
44     curl_off_t retryAfter;
45     long proxyError;
46     curl_off_t queueTime;
47     long curlCode;
48     long requestStartTime;
49 } DataTransHttpInfo;
50 
51 typedef struct DataTransTcpInfo {
52     uint32_t unacked;
53     uint32_t lastDataSent;
54     uint32_t lastAckSent;
55     uint32_t lastDataRecv;
56     uint32_t lastAckRecv;
57     uint32_t rtt;
58     uint32_t rttvar;
59     uint16_t retransmits;
60     uint32_t totalRetrans;
61     std::string srcIp;
62     std::string dstIp;
63     uint16_t srcPort;
64     uint16_t dstPort;
65 } DataTransTcpInfo;
66 
67 typedef struct DataTransChrStats {
68     std::string processName;
69     DataTransHttpInfo httpInfo;
70     DataTransTcpInfo tcpInfo;
71 } DataTransChrStats;
72 }  // namespace OHOS::NetStack
73 #endif  // COMMUNICATIONNETSTACK_I_NETSTACK_CHR_CLIENT_H