1 /*
2  * Copyright (C) 2021 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 CELLULAR_DATA_UTILS_H
17 #define CELLULAR_DATA_UTILS_H
18 
19 #include <vector>
20 #include <utility>
21 
22 #include "parameter.h"
23 
24 #include "cellular_data_constant.h"
25 #include "cellular_data_state_machine.h"
26 
27 namespace OHOS {
28 namespace Telephony {
29 class CellularDataUtils {
30 public:
31     static std::vector<AddressInfo> ParseIpAddr(const std::string &address);
32     static std::vector<AddressInfo> ParseNormalIpAddr(const std::string &address);
33     static std::vector<RouteInfo> ParseRoute(const std::string &address);
34     static std::vector<std::string> Split(const std::string &input, const std::string &flag);
35     static int32_t GetPrefixLen(const std::string &netmask, const std::string& flag);
36     static int32_t GetPrefixLen(const std::vector<std::string> &netmask, const size_t start);
37     static int GetDefaultMobileMtuConfig();
38     static bool GetDefaultPreferApnConfig();
39     static bool GetDefaultMultipleConnectionsConfig();
40     static std::string ConvertRadioTechToRadioName(const int32_t radioTech);
41 
42 private:
43     CellularDataUtils() = default;
44     ~CellularDataUtils() = default;
45 };
46 } // namespace Telephony
47 } // namespace OHOS
48 #endif // CELLULAR_DATA_UTILS_H
49