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 NET_STATS_DATABASE_DEFINES_H 17 #define NET_STATS_DATABASE_DEFINES_H 18 19 #include <map> 20 21 #include "netmanager_base_common_utils.h" 22 #include "net_stats_info.h" 23 24 namespace OHOS { 25 namespace NetManagerStandard { 26 namespace NetStatsDatabaseDefines { 27 constexpr const char *NET_STATS_DATABASE_PATH = "/data/service/el1/public/netmanager/net_stats_data.db"; 28 constexpr const char *UID_TABLE_CREATE_PARAM = 29 "UID INTEGER NOT NULL," 30 "IFace CHAR(50) NOT NULL," 31 "Date INTEGER NOT NULL," 32 "RxBytes INTEGER NOT NULL," 33 "RxPackets INTEGER NOT NULL," 34 "TxBytes INTEGER NOT NULL," 35 "TxPackets INTEGER NOT NULL"; 36 constexpr const char *IFACE_TABLE_CREATE_PARAM = 37 "IFace CHAR(50) NOT NULL," 38 "Date INTEGER NOT NULL," 39 "RxBytes INTEGER NOT NULL," 40 "RxPackets INTEGER NOT NULL," 41 "TxBytes INTEGER NOT NULL," 42 "TxPackets INTEGER NOT NULL"; 43 constexpr const char *UID_TABLE_PARAM_LIST = "UID,IFace,Date,RxBytes,RxPackets,TxBytes,TxPackets"; 44 constexpr const char *IFACE_TABLE_PARAM_LIST = "IFace,Date,RxBytes,RxPackets,TxBytes,TxPackets"; 45 constexpr const char *IFACE_TABLE = "T_iface"; 46 constexpr const char *UID_TABLE = "T_uid"; 47 48 constexpr int32_t UID_PARAM_NUM = 7; 49 50 enum class DataType { 51 UID, 52 IFACE, 53 }; 54 } // namespace NetStatsDatabaseDefines 55 } // namespace NetManagerStandard 56 } // namespace OHOS 57 58 #endif // NET_STATS_DATABASE_DEFINES_H 59