• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 DATA_STORAGE_PDP_PROFILE_DATA_H
17 #define DATA_STORAGE_PDP_PROFILE_DATA_H
18 
19 namespace OHOS {
20 namespace Telephony {
21 class PdpProfileData {
22 public:
23     /**
24      * @brief Operator id
25      */
26     static constexpr const char *PROFILE_ID = "profile_id";
27     /**
28      * @brief Operator name
29      */
30     static constexpr const char *PROFILE_NAME = "profile_name";
31     /**
32      * @brief Mobile country code
33      */
34     static constexpr const char *MCC = "mcc";
35     /**
36      * @brief Mobile network code
37      */
38     static constexpr const char *MNC = "mnc";
39     /**
40      * @brief Mobile country code and mobile network code
41      */
42     static constexpr const char *MCCMNC = "mccmnc";
43     /**
44      * @brief APN name
45      */
46     static constexpr const char *APN = "apn";
47     /**
48      * @brief Authentication type
49      */
50     static constexpr const char *AUTH_TYPE = "auth_type";
51     /**
52      * @brief Authentication user
53      */
54     static constexpr const char *AUTH_USER = "auth_user";
55     /**
56      * @brief Authentication password
57      */
58     static constexpr const char *AUTH_PWD = "auth_pwd";
59     /**
60      * @brief APN type
61      */
62     static constexpr const char *APN_TYPES = "apn_types";
63     /**
64      * @brief Roaming or not
65      */
66     static constexpr const char *IS_ROAMING_APN = "is_roaming_apn";
67     /**
68      * @brief Operator enable or not
69      */
70     static constexpr const char *PROFILE_ENABLE = "profile_enable";
71     /**
72      * @brief Mms center url
73      */
74     static constexpr const char *HOME_URL = "home_url";
75     /**
76      * @brief Mms proxy ip address and port
77      */
78     static constexpr const char *PROXY_IP_ADDRESS = "proxy_ip_address";
79     /**
80      * @brief Mms ip address and port
81      */
82     static constexpr const char *MMS_IP_ADDRESS = "mms_ip_address";
83     /**
84      * @brief Protocol to connect to the APN
85      */
86     static constexpr const char *APN_PROTOCOL = "apn_protocol";
87     /**
88      * @brief Protocol to connect to the APN when roaming
89      */
90     static constexpr const char *APN_ROAM_PROTOCOL = "apn_roam_protocol";
91     /**
92      * @brief Radio access family bitmask
93      */
94     static constexpr const char *BEARING_SYSTEM_TYPE = "bearing_system_type";
95 };
96 
97 struct PdpProfile {
98     int profileId = 0;
99     std::string profileName = "";
100     std::string mcc = "";
101     std::string mnc = "";
102     std::string apn = "";
103     int authType = 0;
104     std::string authUser = "";
105     std::string authPwd = "";
106     std::string apnTypes = ""; // see ApnType
107     int isRoamingApn = 0;
108     std::string homeUrl = "";
109     std::string proxyIpAddress = "";
110     std::string mmsIpAddress = "";
111     std::string pdpProtocol = ""; // see PdpProtocol
112     std::string roamPdpProtocol = "";
113     int bearingSystemType = 0; // see BearingSystemType
114 };
115 
116 
117 enum class ApnType {
118     DEFAULT, IMS, MMS, ALL
119 };
120 
121 enum class ApnAuthType {
122     None = 0, PAP, CHAP, PAP_OR_CHAP
123 };
124 
125 enum class PdpProtocol {
126     IPV4 = 0, IPV6, IPV4V6
127 };
128 
129 enum class BearingSystemType {
130     UNKNOWN = 0,
131     LTE,
132     HSPAP,
133     HSPA,
134     HSUPA,
135     HSDPA,
136     UMTS,
137     EDGE,
138     GPRS,
139     eHRPD,
140     EVDO_B,
141     EVDO_A,
142     EVDO_0,
143     xRTT,
144     IS95B,
145     IS95AS
146 };
147 
148 constexpr const char *TABLE_PDP_PROFILE = "pdp_profile";
149 constexpr const char *TEMP_TABLE_PDP_PROFILE = "temp_pdp_profile";
150 constexpr const char *PDP_PROFILE_URI = "datashare:///com.ohos.pdpprofileability";
151 } // namespace Telephony
152 } // namespace OHOS
153 #endif // DATA_STORAGE_PDP_PROFILE_DATA_H
154