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 OHOS_RIL_VENDOR_DATA_DEFS_H 17 #define OHOS_RIL_VENDOR_DATA_DEFS_H 18 19 #include "hril_public_struct.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /** 26 * @brief Defines the data call response. 27 */ 28 typedef struct { 29 /** Data call fail reason. success is 0 */ 30 int32_t reason; 31 32 /** If errorCode != 0, suggested retry time */ 33 int32_t retryTime; 34 35 /** 36 * From 3GPP TS 27.007 V17.3.0 (2021-09) 37 * Specifies a particular PDP context definition. The parameter is local to 38 * the TE-MT interface and is used in other PDP context-related commands. 39 */ 40 int32_t cid; 41 42 /** 43 * From 3GPP TS 27.007 V17.3.0 (2021-09) 44 * Indicates the state of PDP context activation 45 * 0: deactivated 46 * 1: activated 47 */ 48 int32_t active; 49 50 /** 51 * PDP_type values from 3GPP TS 27.007 V17.3.0 (2021-09) 52 * Specifies the type of packet data protocol. The default value is 53 * manufacturer specific. 54 */ 55 char *type; 56 57 /** 58 * Network interface name 59 */ 60 char *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 * "a1.a2.a3.a4.m1.m2.m3.m4" for IPv4 or 68 * "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 char *address; 74 75 /** Shows the IP address of the primary DNS server. */ 76 char *dns; 77 78 /** 79 * From 3GPP TS 27.007 V17.3.0 (2021-09) 80 * string type; shows the IP address of the secondary DNS server.When 81 * +CGPIAF is supported, its settings can influence the format of this 82 * parameter returned with the execute form of +CGCONTRDP. 83 */ 84 char *dnsSec; 85 86 /** 87 * Shows the Gateway Address of the MT. The string is given as 88 * dot-separated numeric (0- 255) parameters. 89 */ 90 char *gateway; 91 92 /** Maximum Transfer Unit. shows the IPv4 MTU size in octets. */ 93 int32_t maxTransferUnit; 94 95 /** 96 * From 3GPP TS 27.007 V17.3.0 (2021-09) 97 * string type; shows the IP address of the primary P-CSCF server.When 98 * +CGPIAF is supported, its settings can influence the format of this 99 * parameter returned with the execute form of +CGCONTRDP. 100 */ 101 char *pCscfPrimAddr; 102 103 /** 104 * From 3GPP TS 27.007 V17.3.0 (2021-09) 105 * string type; shows the IP address of the secondary P-CSCF server. When 106 * +CGPIAF is supported, its settings can influence the format of this 107 * parameter returned with the execute form of +CGCONTRDP. 108 */ 109 char *pCscfSecAddr; 110 111 /** 112 * From 3GPP TS 27.007 V17.3.0 (2021-09) 113 * integer type; identifies the PDU session, see 3GPP TS 24.501 [161]. 114 */ 115 int32_t pduSessionId; 116 } HRilDataCallResponse; 117 118 /** 119 * @brief Defines the data information. from 3GPP TS 27.007 V17.3.0 (2021-09) 120 */ 121 typedef struct { 122 /** 123 * Specifies a particular PDP context definition. The parameter is local to 124 * the TE-MT interface and is used in other PDP context-related commands. 125 */ 126 int32_t cid; 127 128 /** Reason for the data request. */ 129 int32_t reason; 130 131 /** Radio Access Technology */ 132 int32_t rat; 133 134 /** Roaming Enable. eg: 1--enable, 0--disnable */ 135 int32_t roamingEnable; 136 137 /** 138 * Authentication protocol used for this PDP context. 139 * 0: None. Used to indicate that no authentication protocol is used for this 140 * PDP context. Username and password are removed if previously specified. 141 * 1: PAP 142 * 2: CHAP 143 */ 144 int32_t verType; 145 146 /** User name for access to the IP network. */ 147 char *userName; 148 149 /** Password for access to the IP network. */ 150 char *password; 151 152 /** Access Point Name */ 153 char *apn; 154 155 /** 156 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 157 * Specifies the type of packet data protocol. The default value is 158 * manufacturer specific. 159 */ 160 char *type; 161 162 /** 163 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 164 * Specifies the type of packet data protocol. The default value is 165 * manufacturer specific. 166 */ 167 char *roamingType; 168 } HRilDataInfo; 169 170 typedef struct { 171 /** 172 * Specifies a particular PDP context definition. The parameter is local to 173 * the TE-MT interface and is used in other PDP context-related commands. 174 */ 175 int32_t cid; 176 177 /** Reason for the data request. */ 178 int32_t reason; 179 180 /** Radio Access Technology */ 181 int32_t rat; 182 183 /** Roaming Enable. eg: 1--enable, 0--disnable */ 184 int32_t roamingEnable; 185 186 /** 187 * Authentication protocol used for this PDP context. 188 * 0: None. Used to indicate that no authentication protocol is used for this 189 * PDP context. Username and password are removed if previously specified. 190 * 1: PAP 191 * 2: CHAP 192 */ 193 int32_t verType; 194 195 /** User name for access to the IP network. */ 196 char *userName; 197 198 /** Password for access to the IP network. */ 199 char *password; 200 201 /** Access Point Name */ 202 char *apn; 203 204 /** 205 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 206 * Specifies the type of packet data protocol. The default value is 207 * manufacturer specific. 208 */ 209 char *type; 210 211 /** 212 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 213 * Specifies the type of packet data protocol. The default value is 214 * manufacturer specific. 215 */ 216 char *roamingType; 217 218 /** 219 * Supported apn types bitmap 220 */ 221 int32_t supportedApnTypesBitmap; 222 } HRilDataInfoWithApnTypes; 223 224 typedef struct { 225 /** 226 * Specifies a particular PDP context definition. The parameter is local to 227 * the TE-MT interface and is used in other PDP context-related commands. 228 */ 229 int32_t cid; 230 231 /** Reason for the data request. */ 232 int32_t reason; 233 234 /** Radio Access Technology */ 235 int32_t rat; 236 237 /** Roaming Enable. eg: 1--enable, 0--disnable */ 238 int32_t roamingEnable; 239 240 /** 241 * Authentication protocol used for this PDP context. 242 * 0: None. Used to indicate that no authentication protocol is used for this 243 * PDP context. Username and password are removed if previously specified. 244 * 1: PAP 245 * 2: CHAP 246 */ 247 int32_t verType; 248 249 /** User name for access to the IP network. */ 250 char *userName; 251 252 /** Password for access to the IP network. */ 253 char *password; 254 255 /** Access Point Name */ 256 char *apn; 257 258 /** 259 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 260 * Specifies the type of packet data protocol. The default value is 261 * manufacturer specific. 262 */ 263 char *type; 264 265 /** 266 * PDP_type values from 3GPP TS 27.007 section 10.1.1. 267 * Specifies the type of packet data protocol. The default value is 268 * manufacturer specific. 269 */ 270 char *roamingType; 271 272 /** 273 * Supported apn types bitmap 274 */ 275 int32_t supportedApnTypesBitmap; 276 277 char *sscmode; 278 279 char *snssai; 280 } HRilDataInfoWithApnTypesforSlice; 281 282 /** 283 * @brief Defines the band width information. 284 */ 285 typedef struct { 286 /** 287 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 288 * integer type; specifies a particular QoS flow definition, Traffic Flows 289 * definition and a PDP Context definition (see the +CGDCONT and +CGDSCONT 290 * commands). 291 */ 292 int32_t cid; 293 294 /** 295 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 296 * 0 5QI is selected by network 297 * [1 - 4] value range for guaranteed bit rate QoS flows 298 * 65, 66, 67 values for guaranteed bit rate QoS flows 299 * [71 - 76] value range for guaranteed bit rate QoS flows 300 * [5 - 9] value range for non-guaranteed bit rate QoS flows 301 * 69, 70, 79, 80 values for non-guaranteed bit rate QoS flows 302 * [82 - 85] value range for delay critical guaranteed bit rate QoS flows 303 * [128 - 254] value range for Operator-specific 5QIs 304 */ 305 int32_t qi; 306 307 /** 308 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 309 * integer type; indicates DL GFBR in case of GBR 5QI. The value is in 310 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 311 * [161]) 312 */ 313 int32_t dlGfbr; 314 315 /** 316 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 317 * integer type; indicates UL GFBR in case of GBR 5QI. The value is in 318 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 319 * [161]). 320 */ 321 int32_t ulGfbr; 322 323 /** 324 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 325 * integer type; indicates DL MFBR in case of GBR 5QI. The value is in 326 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 327 * [161]). 328 */ 329 int32_t dlMfbr; 330 331 /** 332 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 333 * integer type; indicates UL MFBR in case of GBR 5QI. The value is in 334 * kbit/s. This parameter is omitted for a non-GBR 5QI (see 3GPP TS 24.501 335 * [161]). 336 */ 337 int32_t ulMfbr; 338 339 /** 340 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 341 * integer type; indicates the UL session AMBR(see 3GPP TS 24.501 [161]). 342 * The value is in kbit/s. 343 */ 344 int32_t ulSambr; 345 346 /** 347 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 348 * integer type; indicates the DL session AMBR(see 3GPP TS 24.501 [161]). 349 * The value is in kbit/s. 350 */ 351 int32_t dlSambr; 352 353 /** 354 * From 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10) 355 * integer type; indicates the averaging window(see 3GPP TS 24.501 [161]). 356 * The value is in milliseconds. 357 */ 358 int32_t averagingWindow; 359 } HRilLinkBandwidthInfo; 360 361 /** 362 * @brief Defines the network bandwidth reporting rule. 363 */ 364 typedef struct { 365 /** Radio Access Technology*/ 366 RatType rat; 367 368 /** 369 * integer type; (0,1,2,…) indicates the targeted time between request to 370 * transfer an SDU at one SAP to its delivery at the other SAP, in 371 * milliseconds. If the parameter is set to '0' the subscribed value will 372 * be requested (refer 3GPP TS 24.008 [8] clause 10.5.6.5). 373 */ 374 int32_t delayMs; 375 376 /** Uplink delay. */ 377 int32_t delayUplinkKbps; 378 379 /** Downlink delay. */ 380 int32_t delayDownlinkKbps; 381 382 /** Maximum number of uplink parameters. */ 383 int32_t maximumUplinkKbpsSize; 384 385 /** Maximum number of downlink parameters. */ 386 int32_t maximumDownlinkKbpsSize; 387 388 /** Maximum uplink parameter list. */ 389 int32_t *maximumUplinkKbps; 390 391 /** Maximum downlink parameter list. */ 392 int32_t *maximumDownlinkKbps; 393 } HRilLinkBandwidthReportingRule; 394 395 /** 396 * @brief Defines the data service performance mode. 397 */ 398 typedef struct { 399 /** Performance Enable. eg: 1-enable, 0-disable */ 400 int32_t performanceEnable; 401 402 /** Whether Enforce Data Performance. eg: 1-enable, 0-disable */ 403 int32_t enforce; 404 } HRilDataPerformanceInfo; 405 406 /** 407 * @brief Defines the sleep mode for data services. 408 */ 409 typedef struct { 410 /** Sleep Mode Enable. eg: 1-enable, 0-disable */ 411 int32_t sleepEnable; 412 } HRilDataSleepInfo; 413 414 /** 415 * @brief Defines the data link capability. 416 */ 417 typedef struct { 418 /** Primary downlink capability in kbps. */ 419 int32_t primaryDownlinkKbps; 420 421 /** Primary uplink capability in kbps. */ 422 int32_t primaryUplinkKbps; 423 424 /** Secondary downlink capability in kbps. */ 425 int32_t secondaryDownlinkKbps; 426 427 /** Secondary uplink capability in kbps. */ 428 int32_t secondaryUplinkKbps; 429 } HRilDataLinkCapability; 430 431 typedef struct { 432 int uePolicyDecodeResultInfoSize; 433 unsigned char *uePolicyDecodeResultInfo; 434 } HRilUePolicyDecodeResult; 435 436 typedef struct { 437 int32_t uePolicySectionIdentifierInfoSize; 438 unsigned char *uePolicySectionIdentifierInfo; 439 } HRilUePolicySectionIdentifier; 440 441 typedef struct { 442 int32_t imsRsdListInfoSize; 443 unsigned char *imsRsdListInfo; 444 } HRilImsRsdList; 445 446 typedef struct { 447 int32_t syncAllowedNssaiInfoSize; 448 unsigned char *syncAllowedNssaiInfo; 449 } HRilSyncAllowedNssaiInfo; 450 451 /** 452 * @brief Defines the data request method. 453 */ 454 typedef struct { 455 /** 456 * @brief Sets the initial default network access technology (APN). 457 * 458 * @param requestInfo Request data info, for details, see {@link 459 * ReqDataInfo}. 460 * @see ReqDataInfo 461 */ 462 void (*SetInitApnInfo)(const ReqDataInfo *requestInfo, const HRilDataInfo *data); 463 464 /** 465 * @brief Activates the packet data protocol (PDP) context. 466 * 467 * @param requestInfo Request data info, for details, see {@link 468 * ReqDataInfo}. 469 * @param data Indicates the data information. 470 * @see ReqDataInfo | HRilDataInfo 471 */ 472 void (*ActivatePdpContext)(const ReqDataInfo *requestInfo, const HRilDataInfo *data); 473 474 /** 475 * @brief Deactivates the PDP context. 476 * 477 * @param requestInfo Request data info, for details, see {@link 478 * ReqDataInfo}. 479 * @param data Indicates the data information. 480 * @see ReqDataInfo | HRilDataInfo 481 */ 482 void (*DeactivatePdpContext)(const ReqDataInfo *requestInfo, const HRilDataInfo *data); 483 484 /** 485 * @brief Obtains the PDP context list. 486 * 487 * @param requestInfo Request data info, for details, see {@link 488 * ReqDataInfo}. 489 * @see ReqDataInfo 490 */ 491 void (*GetPdpContextList)(const ReqDataInfo *requestInfo); 492 493 /** 494 * @brief Obtains the current link information. 495 * 496 * @param requestInfo Request data info, for details, see {@link 497 * ReqDataInfo}. 498 * @param cid Indicates a particular PDP context definition. 499 * @see ReqDataInfo 500 */ 501 void (*GetLinkBandwidthInfo)(const ReqDataInfo *requestInfo, int32_t cid); 502 503 /** 504 * @brief Sets the rule for reporting the data link bandwidth information. 505 * 506 * @param requestInfo Request data info, for details, see {@link 507 * ReqDataInfo}. 508 * @param data Indicates the network bandwidth reporting rule. 509 * @see ReqDataInfo | HRilLinkBandwidthReportingRule 510 */ 511 void (*SetLinkBandwidthReportingRule)(const ReqDataInfo *requestInfo, const HRilLinkBandwidthReportingRule *data); 512 513 /** 514 * @brief Sets the PDP context information for the data service. 515 * 516 * @param requestInfo Request data info, for details, see {@link 517 * ReqDataInfo}. 518 * @param data Indicates the data information. 519 * @param len Indicates the length of data. 520 * @see ReqDataInfo | HRilDataInfo 521 */ 522 void (*SetDataProfileInfo)(const ReqDataInfo *requestInfo, const HRilDataInfo *data, int32_t len); 523 524 /** 525 * @brief Sends the data service performance mode. 526 * 527 * @param requestInfo Request data info, for details, see {@link 528 * ReqDataInfo}. 529 * @param data Indicates the data service performance mode. 530 * @see ReqDataInfo | HRilDataPerformanceInfo 531 */ 532 void (*SendDataPerformanceMode)(const ReqDataInfo *requestInfo, const HRilDataPerformanceInfo *data); 533 534 /** 535 * @brief Sends the data service sleep mode. 536 * 537 * @param requestInfo Request data info, for details, see {@link 538 * ReqDataInfo}. 539 * @param data Indicates the sleep mode for data services. 540 * @see ReqDataInfo | HRilDataSleepInfo 541 */ 542 void (*SendDataSleepMode)(const ReqDataInfo *requestInfo, const HRilDataSleepInfo *data); 543 544 /** 545 * @brief Enables the data service of a SIM card slot. 546 * 547 * @param requestInfo Request data info, for details, see {@link 548 * ReqDataInfo}. 549 * @param enabled Whether to enable the data service. 550 * @see ReqDataInfo 551 */ 552 void (*SetDataPermitted)(const ReqDataInfo *requestInfo, int32_t enabled); 553 554 /** 555 * @brief Get link capability. 556 * 557 * @param requestInfo Request data info, for details, see {@link 558 * ReqDataInfo}. 559 * @see ReqDataInfo 560 */ 561 void (*GetLinkCapability)(const ReqDataInfo *requestInfo); 562 563 /** 564 * @brief Clean all data connections. 565 * 566 * @param requestInfo Request data info, for details, see {@link 567 * ReqDataInfo}. 568 * @see ReqDataInfo 569 */ 570 void (*CleanAllConnections)(const ReqDataInfo *requestInfo); 571 572 /** 573 * @brief Activates the packet data protocol (PDP) context with apnTypes. 574 * 575 * @param requestInfo Request data info, for details, see {@link 576 * ReqDataInfo}. 577 * @param data Indicates the data information. 578 * @see ReqDataInfo | HRilDataInfoWithApnTypes 579 */ 580 void (*ActivatePdpContextWithApnTypes)(const ReqDataInfo *requestInfo, const HRilDataInfoWithApnTypes *data); 581 582 /** 583 * @brief Send UePolicy Complete. 584 * 585 * @param requestInfo Request data info, for details, see {@link 586 * ReqDataInfo}. 587 * @see ReqDataInfo 588 */ 589 void (*SendUrspDecodeResult)(const ReqDataInfo *requestInfo, const HRilUePolicyDecodeResult *data); 590 591 /** 592 * @brief Send Ue State Indication. 593 * 594 * @param requestInfo Request data info, for details, see {@link 595 * ReqDataInfo}. 596 * @see ReqDataInfo 597 */ 598 void (*SendUePolicySectionIdentifier)(const ReqDataInfo *requestInfo, const HRilUePolicySectionIdentifier *data); 599 600 /** 601 * @brief Send Ue State Indication. 602 * 603 * @param requestInfo Request data info, for details, see {@link 604 * ReqDataInfo}. 605 * @see ReqDataInfo 606 */ 607 void (*SendImsRsdList)(const ReqDataInfo *requestInfo, const HRilImsRsdList *data); 608 609 /** 610 * @brief Sync Allowed Nssai WithModem. 611 * 612 * @param requestInfo Request data info, for details, see {@link 613 * ReqDataInfo}. 614 * @see ReqDataInfo 615 */ 616 void (*GetNetworkSliceAllowedNssai)(const ReqDataInfo *requestInfo, const HRilSyncAllowedNssaiInfo *data); 617 618 /** 619 * @brief Sync Ehplmn WithModem. 620 * 621 * @param requestInfo Request data info, for details, see {@link 622 * ReqDataInfo}. 623 * @see ReqDataInfo 624 */ 625 void (*GetNetworkSliceEhplmn)(const ReqDataInfo *requestInfo); 626 627 /** 628 * @brief Activates the packet data protocol (PDP) context with apnTypes for slice. 629 * 630 * @param requestInfo Request data info, for details, see {@link 631 * ReqDataInfo}. 632 * @param data Indicates the data information. 633 * @see ReqDataInfo | HRilDataInfoWithApnTypesforSlice 634 */ 635 void (*ActivatePdpContextWithApnTypesforSlice)(const ReqDataInfo *requestInfo, 636 const HRilDataInfoWithApnTypesforSlice *data); 637 } HRilDataReq; 638 #ifdef __cplusplus 639 } 640 #endif 641 #endif // OHOS_RIL_VENDOR_DATA_DEFS_H 642