1 /* 2 * Copyright (C) 2024 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 OHOS_TEL_RIL_DATA_PARCEL_H 17 #define OHOS_TEL_RIL_DATA_PARCEL_H 18 19 #include "tel_ril_base_parcel.h" 20 #include "tel_ril_enum.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 /** 25 * @brief Defines the data service activation result. 26 */ 27 struct SetupDataCallResultInfo { 28 /** Activation result ID. */ 29 int32_t flag = 0; 30 31 /** Data call fail reason, success is 0. */ 32 int32_t reason = 0; 33 34 /** If errorCode != 0, suggested retry time. */ 35 int32_t retryTime = 0; 36 37 /** 38 * From 3GPP TS 27.007 V17.3.0 (2021-09), specifies a particular PDP 39 * context definition. The parameter is local to the TE-MT interface and is 40 * used in other PDP context-related commands. 41 */ 42 int32_t cid = 0; 43 44 /** 45 * From 3GPP TS 27.007 V17.3.0 (2021-09), indicates the state of PDP 46 * context activation. 47 * 0: deactivated 48 * 1: activated 49 */ 50 int32_t active = 0; 51 52 /** 53 * PDP_type values from 3GPP TS 27.007 V17.3.0 (2021-09) 54 * Specifies the type of packet data protocol. The default value is 55 * manufacturer specific. 56 */ 57 std::string type = ""; 58 59 /** Network interface name. */ 60 std::string netPortName = ""; 61 62 /** 63 * From 3GPP TS 27.007 V17.3.0 (2021-09) 64 * <local_addr and subnet_mask>: string type; 65 * shows the IP address and subnet mask of the MT. The string is given as 66 * dot-separated numeric (0-255) parameters on the form: 67 * 1. "a1.a2.a3.a4.m1.m2.m3.m4" for IPv4 or 68 * 2. "a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16. 69 * m1.m2.m3.m4.m5.m6.m7.m8.m9.m10.m11.m12.m13.m14.m15.m16" for IPv6. 70 * When +CGPIAF is supported, its settings can influence the format of this 71 * parameter returned with the execute form of +CGCONTRDP 72 */ 73 std::string address = ""; 74 75 /** 76 * If the MT indicates more than two IP addresses of P-CSCF servers string 77 * type; shows the IP address of the secondary DNS server.When +CGPIAF is 78 * supported, its settings can influence the format of this parameter 79 * returned with the execute form of +CGCONTRDP. 80 */ 81 std::string dns = ""; 82 83 /** 84 * From 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12) 85 * string type; shows the IP address of the secondary DNS server.When 86 * +CGPIAF is supported, its settings can influence the format of this 87 * parameter returned with the execute form of +CGCONTRDP. 88 */ 89 std::string dnsSec = ""; 90 91 /** Network gateway address. */ 92 std::string gateway = ""; 93 94 /** 95 * Maximum Transfer Unit. The range of permitted values (minimum value = 1 96 * or if the initial PDP context is supported minimum value = 0) is 97 * returned by the test form of the command. 98 */ 99 int32_t maxTransferUnit = 0; 100 101 /** 102 * From 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12) 103 * string type; shows the IP address of the primary P-CSCF server.When 104 * +CGPIAF is supported, its settings can influence the format of this 105 * parameter returned with the execute form of +CGCONTRDP. 106 */ 107 std::string pCscfPrimAddr = ""; 108 109 /** 110 * From 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12) 111 * string type; shows the IP address of the secondary P-CSCF server. When 112 * +CGPIAF is supported, its settings can influence the format of this 113 * parameter returned with the execute form of +CGCONTRDP. 114 */ 115 std::string pCscfSecAddr = ""; 116 117 /** 118 * From 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12) 119 * integer type; identifies the PDU session, see 3GPP TS 24.501 [161]. 120 */ 121 int32_t pduSessionId = 0; 122 123 /** retry scene, 124 * 0 - setup datacall fail, 1 - modem deactivate, 2 - others 125 */ 126 int32_t retryScene = 2; 127 }; 128 129 /** 130 * @brief Defines the list of data service activation results. 131 */ 132 struct DataCallResultList { 133 /** Size of DataCall List */ 134 size_t size = 0; 135 136 /** DataCall List. */ 137 std::vector<SetupDataCallResultInfo> dcList {}; 138 }; 139 140 /** 141 * @brief Defines PDP context information in 3GPP TS 27.007 10.1 V4.3.0 142 * (2001-12) 143 */ 144 struct DataProfileDataInfo { 145 /** Request serial number. */ 146 int32_t serial = 0; 147 148 /** Id of data profiles. */ 149 int32_t profileId = 0; 150 151 /** Access Point Name. */ 152 std::string apn = ""; 153 154 /** 155 * (Packet Data Protocol type) a string parameter which specifies the type 156 * of packet data protocol. 157 */ 158 std::string protocol = ""; 159 160 /** Roaming protocol version. */ 161 std::string roamingProtocol = ""; 162 163 /** APN verification type. */ 164 int32_t verType = 0; 165 166 /** Indicates the username of pdp profile. */ 167 std::string userName = ""; 168 169 /** Indicates the password of pdp profile. */ 170 std::string password = ""; 171 }; 172 173 /** 174 * @brief Defines the PDP context list. 175 */ 176 struct DataProfilesInfo { 177 /** Request serial number. */ 178 int32_t serial = 0; 179 180 /** Number of PDP contexts. */ 181 int32_t profilesSize = 0; 182 183 /** PDP context list. */ 184 std::vector<DataProfileDataInfo> profiles {}; 185 186 /** Roaming or not. */ 187 bool isRoaming = false; 188 }; 189 190 /** 191 * @brief Defines the data service information. 192 */ 193 struct DataCallInfo { 194 /** Request serial number. */ 195 int32_t serial = 0; 196 197 /** Voice radio technology. */ 198 int32_t radioTechnology = 0; 199 200 /** PDP context information. */ 201 DataProfileDataInfo dataProfileInfo; 202 203 /** 204 * Whether the PDP context is set for the modem. The value true indicates 205 * that PDP context is set for the modem, and the value false indicates the 206 * opposite. 207 */ 208 bool modemCognitive = false; 209 210 /** 211 * Whether roaming is allowed. The value true indicates that roaming is 212 * allowed, and the value false indicates the opposite. 213 */ 214 bool roamingAllowed = false; 215 216 /** 217 * Whether the user is roaming. The value true indicates that the user is 218 * roaming, and the value false indicates the opposite. 219 */ 220 bool isRoaming = false; 221 }; 222 223 /** 224 * @brief Defines the network bandwidth information. 225 */ 226 struct DataLinkBandwidthInfo { 227 /** Request serial number. */ 228 int32_t serial = 0; 229 230 /** 231 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 232 * integer type; specifies a particular QoS flow definition, Traffic Flows 233 * definition and a PDP Context definition (see the +CGDCONT and +CGDSCONT 234 * commands). 235 */ 236 int32_t cid = 0; 237 238 /** 239 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 240 * 0, 5:QI is selected by network 241 * [1 - 4]: value range for guaranteed bit rate QoS flows 242 * 65, 66, 67: values for guaranteed bit rate QoS flows 243 * [71 - 76]: value range for guaranteed bit rate QoS flows 244 * [5 - 9]: value range for non-guaranteed bit rate QoS flows 245 * 69, 70, 79, 80: values for non-guaranteed bit rate QoS flows 246 * [82 - 85]: value range for delay critical guaranteed bit rate QoS flows 247 * [128 - 254]: value range for Operator-specific 5QIs 248 */ 249 int32_t qi = 0; 250 251 /** 252 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 253 * integer type; indicates DL GFBR in case of GBR 5QI. The value is in 254 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 255 * [161]). 256 */ 257 int32_t dlGfbr = 0; 258 259 /** 260 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 261 * integer type; indicates UL GFBR in case of GBR 5QI. The value is in 262 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 263 * [161]). 264 */ 265 int32_t ulGfbr = 0; 266 267 /** 268 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 269 * integer type; indicates DL MFBR in case of GBR 5QI. The value is in 270 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 271 * [161]). 272 */ 273 int32_t dlMfbr = 0; 274 275 /** 276 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 277 * integer type; indicates UL MFBR in case of GBR 5QI. The value is in 278 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 279 * [161]). 280 */ 281 int32_t ulMfbr = 0; 282 283 /** 284 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 285 * integer type; indicates the UL session AMBR(see 3GPP TS 24.501 [161]). 286 * The value is in kbit/s. 287 */ 288 int32_t ulSambr = 0; 289 290 /** 291 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 292 * integer type; indicates the DL session AMBR(see 3GPP TS 24.501 [161]). 293 * The value is in kbit/s. 294 */ 295 int32_t dlSambr = 0; 296 297 /** 298 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 299 * integer type; indicates the averaging window(see 3GPP TS 24.501 [161]). 300 * The value is in milliseconds. 301 */ 302 int32_t averagingWindow = 0; 303 }; 304 305 /** 306 * @brief Defines the network bandwidth reporting rule. 307 */ 308 struct DataLinkBandwidthReportingRule { 309 /** Request serial number. */ 310 int32_t serial = 0; 311 312 /** Radio access technology. */ 313 int32_t rat = 0; 314 315 /** Delay time. */ 316 int32_t delayMs = 0; 317 318 /** Uplink delay. */ 319 int32_t delayUplinkKbps = 0; 320 321 /** Downlink delay. */ 322 int32_t delayDownlinkKbps = 0; 323 324 /** Maximum number of uplink parameters. */ 325 int32_t maximumUplinkKbpsSize = 0; 326 327 /** Maximum number of downlink parameters. */ 328 int32_t maximumDownlinkKbpsSize = 0; 329 330 /** Maximum uplink parameter list. */ 331 std::vector<int32_t> maximumUplinkKbps {}; 332 333 /** Maximum downlink parameter list. */ 334 std::vector<int32_t> maximumDownlinkKbps {}; 335 }; 336 337 /** 338 * @brief Defines the data service performance mode. 339 */ 340 struct DataPerformanceInfo { 341 /** Data Performance Enable. eg: 1-enable, 0-disable */ 342 int32_t performanceEnable = 0; 343 344 /** Whether Enforce Data Performance. eg: 1-enable, 0-disable */ 345 int32_t enforce = 0; 346 }; 347 348 /** 349 * @brief Defines the sleep mode for data services. 350 */ 351 struct DataSleepInfo { 352 /** Sleep Mode Enable. eg: 1-enable, 0-disable */ 353 int32_t sleepEnable = 0; 354 }; 355 356 /** 357 * @brief Defines the data link capability. 358 */ 359 struct DataLinkCapability { 360 /** Primary downlink capability in kbps. */ 361 int32_t primaryDownlinkKbps; 362 363 /** Primary uplink capability in kbps. */ 364 int32_t primaryUplinkKbps; 365 366 /** Secondary downlink capability in kbps. */ 367 int32_t secondaryDownlinkKbps; 368 369 /** Secondary uplink capability in kbps. */ 370 int32_t secondaryUplinkKbps; 371 }; 372 373 struct NetworkSliceUrspInfo { 374 /** urspInfo. */ 375 std::vector<uint8_t> urspInfo {}; 376 }; 377 378 struct NetworkSliceAllowedNssaiInfo { 379 /** allowednssaiInfo. */ 380 std::vector<uint8_t> allowednssaiInfo {}; 381 }; 382 383 struct NetworkSliceEhplmnInfo { 384 /** ehplmnInfo. */ 385 std::vector<uint8_t> ehplmnInfo {}; 386 }; 387 } // namespace Telephony 388 } // namespace OHOS 389 #endif // OHOS_TEL_RIL_DATA_PARCEL_H 390