• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.radio@1.6;
18
19import @1.0::CdmaSignalStrength;
20import @1.0::EvdoSignalStrength;
21import @1.0::GsmSignalStrength;
22import @1.0::LteSignalStrength;
23import @1.0::RadioError;
24import @1.0::RadioResponseType;
25import @1.0::RegState;
26import @1.1::EutranBands;
27import @1.1::GeranBands;
28import @1.1::ScanStatus;
29import @1.1::UtranBands;
30import @1.1::ImsiEncryptionInfo;
31import @1.2::Call;
32import @1.2::CellInfoCdma;
33import @1.2::CellConnectionStatus;
34import @1.2::TdscdmaSignalStrength;
35import @1.2::WcdmaSignalStrength;
36import @1.4::DataCallFailCause;
37import @1.4::DataConnActiveStatus;
38import @1.4::NrSignalStrength;
39import @1.4::PdpProtocolType;
40import @1.4::RadioTechnology;
41import @1.5::CellIdentity;
42import @1.5::CellIdentityLte;
43import @1.5::CellIdentityNr;
44import @1.5::CellInfoGsm;
45import @1.5::CellInfoWcdma;
46import @1.5::CellInfoTdscdma;
47import @1.5::LinkAddress;
48import @1.5::NgranBands;
49import @1.5::RegStateResult.AccessTechnologySpecificInfo.Cdma2000RegistrationInfo;
50import @1.5::RegStateResult.AccessTechnologySpecificInfo.EutranRegistrationInfo;
51import @1.5::RegistrationFailCause;
52import @1.5::SetupDataCallResult;
53
54import android.hidl.safe_union@1.0::Monostate;
55
56struct QosBandwidth {
57    /** Maximum bit rate possible on the bearer */
58    uint32_t maxBitrateKbps;
59    /** Minimum bit rate that is guaranteed to be provided by the network */
60    uint32_t guaranteedBitrateKbps;
61};
62
63/** LTE/EPS Quality of Service parameters as per 3gpp spec 24.301 sec 9.9.4.3. */
64struct EpsQos {
65    /**
66     * Quality of Service Class Identifier (QCI), see 3GPP TS 23.203 and 29.212.
67     * The allowed values are standard values(1-9, 65-68, 69-70, 75, 79-80, 82-85)
68     * defined in the spec and operator specific values in the range 128-254.
69     */
70    uint16_t qci;
71    QosBandwidth downlink;
72    QosBandwidth uplink;
73};
74
75/** 5G Quality of Service parameters as per 3gpp spec 24.501 sec 9.11.4.12 */
76struct NrQos {
77    /**
78     * 5G QOS Identifier (5QI), see 3GPP TS 24.501 and 23.501.
79     * The allowed values are standard values(1-9, 65-68, 69-70, 75, 79-80, 82-85)
80     * defined in the spec and operator specific values in the range 128-254.
81     */
82    uint16_t fiveQi;
83    QosBandwidth downlink;
84    QosBandwidth uplink;
85    /**
86     * QOS flow identifier of the QOS flow description in the
87     * range of QosFlowIdRange::MIN to QosFlowIdRange::MAX
88     */
89    uint8_t qfi;
90    uint16_t averagingWindowMs;
91};
92
93/** Allowed values for 5G QOS flow identifier */
94enum QosFlowIdRange : uint8_t {
95    MIN = 1,
96    MAX = 63
97};
98
99/** EPS or NR QOS parameters */
100safe_union Qos {
101    Monostate noinit;
102    EpsQos eps;
103    NrQos nr;
104};
105
106/**
107 * Next header protocol numbers defined by IANA, RFC 5237
108 */
109enum QosProtocol : int8_t {
110    /** No protocol specified */
111    UNSPECIFIED = -1,
112    /** Transmission Control Protocol */
113    TCP = 6,
114    /** User Datagram Protocol */
115    UDP = 17,
116    /** Encapsulating Security Payload Protocol */
117    ESP = 50,
118    /** Authentication Header */
119    AH = 51,
120};
121
122enum QosFilterDirection : int8_t {
123    DOWNLINK = 0,
124    UPLINK = 1,
125    BIDIRECTIONAL = 2,
126};
127
128/** Allowed port numbers */
129enum QosPortRange : uint16_t {
130    MIN = 20,
131    MAX = 65535
132};
133
134enum RadioError : @1.0::RadioError {
135    /** 1X voice and SMS are not allowed simulteneously. */
136    SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67,
137
138    /** Access is barred. */
139    ACCESS_BARRED = 68,
140
141    /**
142     * SMS is blocked due to call control, e.g., resource unavailable
143     * in the SMR entity.
144     */
145    BLOCKED_DUE_TO_CALL = 69,
146
147    /**
148     * Returned from setRadioPowerResponse when detecting RF HW issues. Some RF
149     * Front-End(RFFE) components like antenna are considered critical for modem
150     * to provide telephony service. This RadioError is used when modem detect
151     * such RFFE problem.
152     */
153    RF_HARDWARE_ISSUE = 70,
154
155    /**
156     * Returned from setRadioPowerResponse when detecting no RF calibration
157     * issue. Unlike RF_HARDWARE_ISSUE, this is a SW problem and no HW repair is
158     * needed.
159     */
160    NO_RF_CALIBRATION_INFO = 71,
161};
162
163/**
164 * Overwritten from @1.0::RadioResponseInfo in order to update the RadioError to 1.6 version.
165 */
166struct RadioResponseInfo {
167    RadioResponseType type;               // Response type
168    int32_t serial;                       // Serial number of the request
169    RadioError error;                     // Response error
170};
171
172/**
173 * Defines range of ports. start and end are the first and last port numbers
174 * (inclusive) in the range. Both start and end are in QosPortRange.MIN to
175 * QosPortRange.MAX range. A single port shall be represented by the same
176 * start and end value.
177 */
178struct PortRange {
179    int32_t start;
180    int32_t end;
181};
182
183/** Port is optional, contains either single port or range of ports */
184safe_union MaybePort {
185    Monostate noinit;
186    PortRange range;
187};
188
189/** See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13 */
190struct QosFilter {
191    /**
192     * Local and remote IP addresses, typically one IPv4 or one IPv6
193     * or one of each. Addresses could be with optional "/" prefix
194     * length, e.g.,"192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
195     * If the prefix length is absent the addresses are assumed to be
196     * point to point with IPv4 having a prefix length of 32 and
197     * IPv6 128.
198     */
199    vec<string> localAddresses;
200    vec<string> remoteAddresses;
201
202    /** Local and remote port/ranges */
203    MaybePort localPort;
204    MaybePort remotePort;
205
206    /** QoS protocol */
207    QosProtocol protocol;
208
209    /** Type of service value or mask as defined in RFC 1349 */
210    safe_union TypeOfService {
211         Monostate noinit;
212         uint8_t value;
213    } tos;
214
215    /** IPv6 flow label as defined in RFC 6437 */
216    safe_union Ipv6FlowLabel {
217         Monostate noinit;
218         uint32_t value;
219    } flowLabel;
220
221    /** IPSec security parameter index */
222    safe_union IpsecSpi {
223         Monostate noinit;
224         uint32_t value;
225    } spi;
226
227    /** Filter direction */
228    QosFilterDirection direction;
229
230    /**
231     * Specifies the order in which the filter needs to be matched.
232     * A lower numerical(positive) value has a higher precedence.
233     * Set -1 when unspecified.
234     */
235    int32_t precedence;
236};
237
238/** QOS session associated with a dedicated bearer */
239struct QosSession {
240    /** Unique ID of the QoS session within the data call */
241    int32_t qosSessionId;
242
243    /** QOS attributes */
244    Qos qos;
245
246    /** List of QOS filters associated with this session */
247    vec<QosFilter> qosFilters;
248};
249
250/** The allowed failure modes on an IWLAN handover failure. */
251enum HandoverFailureMode : int8_t {
252    /**
253     * On data handover failure, fallback to the source data transport when the
254     * fail cause is due to a hand off preference change.
255     */
256    LEGACY = 0,
257
258    /** On data handover failure, fallback to the source data transport. */
259    DO_FALLBACK = 1,
260
261    /**
262     * On data handover failure, retry the handover instead of falling back to
263     * the source data transport.
264     */
265    NO_FALLBACK_RETRY_HANDOVER = 2,
266
267    /**
268     * On data handover failure, setup a new data connection by sending a normal
269     * request to the underlying data service.
270     */
271    NO_FALLBACK_RETRY_SETUP_NORMAL = 3
272};
273
274/**
275 * Overwritten from @1.5::SetupDataCallResult in order to change the suggestedRetryTime
276 * to 64-bit value. In the future, this must be extended instead of overwritten.
277 * Also added defaultQos, qosSessions, handoverFailureMode, pduSessionId, sliceInfo,
278 * and traffic descriptors in this version.
279 */
280struct SetupDataCallResult {
281    /** Data call fail cause. DataCallFailCause.NONE if no error. */
282    DataCallFailCause cause;
283
284    /**
285     * If cause is not DataCallFailCause.NONE, this field indicates the network suggested data
286     * retry back-off time in milliseconds. Negative value indicates network does not give any
287     * suggestion. 0 indicates retry should be performed immediately. 0x7fffffffffffffff indicates
288     * the device should not retry data setup anymore.
289     *
290     * During this time, no calls to IRadio@1.6::SetupDataCall for this APN will be made unless
291     * IRadioIndication@1.6::unthrottleApn is sent with the same APN.
292     */
293    int64_t suggestedRetryTime;
294
295    /** Context ID, uniquely identifies this data connection. */
296    int32_t cid;
297
298    /** Data connection active status. */
299    DataConnActiveStatus active;
300
301    /**
302     * PDP protocol type. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the
303     * protocol type supported, such as "IP" or "IPV6".
304     */
305    PdpProtocolType type;
306
307    /** The network interface name. */
308    string ifname;
309
310    /**
311     * List of link address.
312     */
313    vec<LinkAddress> addresses;
314
315    /**
316     * List of DNS server addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". Empty if no dns
317     * server addresses returned.
318     */
319    vec<string> dnses;
320
321    /**
322     * List of default gateway addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
323     * When empty, the addresses represent point to point connections.
324     */
325    vec<string> gateways;
326
327    /**
328     * List of P-CSCF(Proxy Call State Control Function) addresses via PCO(Protocol Configuration
329     * Option), e.g., "2001:db8::1 2001:db8::2 2001:db8::3". Empty if not IMS client.
330     */
331    vec<string> pcscf;
332
333    /**
334     * MTU received from network for IPv4.
335     * Value <= 0 means network has either not sent a value or sent an invalid value.
336     */
337    int32_t mtuV4;
338
339    /**
340     * MTU received from network for IPv6.
341     * Value <= 0 means network has either not sent a value or sent an invalid value.
342     */
343    int32_t mtuV6;
344
345    /** Default bearer QoS. Applicable to LTE and NR */
346    Qos defaultQos;
347
348    /**
349     * Active QOS sessions of the dedicated bearers. Applicable to
350     * PDNs that support dedicated bearers.
351     */
352    vec<QosSession> qosSessions;
353
354    /** Specifies the fallback mode on an IWLAN handover failure. */
355    HandoverFailureMode handoverFailureMode;
356
357    /**
358     * The allocated pdu session id for this data call.
359     * A value of 0 means no pdu session id was attached to this call.
360     *
361     * Reference: 3GPP TS 24.007 section 11.2.3.1b
362     */
363    int32_t pduSessionId;
364
365    /**
366     * Slice used for this data call. It is valid only when this data call is on
367     * AccessNetwork:NGRAN.
368     */
369    OptionalSliceInfo sliceInfo;
370
371    /**
372     * TrafficDescriptors for which this data call must be used. It only includes
373     * the TDs for which a data call has been requested so far; it is not an
374     * exhaustive list.
375     */
376    vec<TrafficDescriptor> trafficDescriptors;
377};
378
379/**
380 * NR Dual connectivity state
381 */
382enum NrDualConnectivityState: int8_t {
383    /**
384     * Enable NR dual connectivity. Enabled state does not mean dual connectivity
385     * is active. It means device is allowed to connect to both primary and secondary.
386     */
387    ENABLE = 1,
388    /**
389     * Disable NR dual connectivity. Disabled state does not mean secondary cell is released.
390     * Modem will release it only if current bearer is released to avoid radio link failure.
391     */
392    DISABLE = 2,
393    /**
394     * Disable NR dual connectivity and force secondary cell to be released if dual connectivity
395     * was active. This may result in radio link failure.
396     */
397    DISABLE_IMMEDIATE= 3,
398};
399
400/**
401 * Overwritten from @1.2::LinkCapacityEstimate to update LinkCapacityEstimate to 1.6 version.
402 */
403struct LinkCapacityEstimate {
404
405   /**
406    * Estimated downlink capacity in kbps. In case of a dual connected network,
407    * this includes capacity of both primary and secondary. This bandwidth estimate shall be
408    * the estimated maximum sustainable link bandwidth (as would be measured
409    * at the Upper PDCP or SNDCP SAP). If the DL Aggregate Maximum Bit Rate is known,
410    * this value shall not exceed the DL-AMBR for the Internet PDN connection.
411    * This must be filled with 0 if network is not connected.
412    */
413   uint32_t downlinkCapacityKbps;
414
415   /**
416    * Estimated uplink capacity in kbps. In case of a dual connected network,
417    * this includes capacity of both primary and secondary. This bandwidth estimate shall be the
418    * estimated maximum sustainable link bandwidth (as would be measured at the
419    * Upper PDCP or SNDCP SAP). If the UL Aggregate Maximum Bit Rate is known,
420    * this value shall not exceed the UL-AMBR for the Internet PDN connection.
421    * This must be filled with 0 if network is not connected.
422    */
423   uint32_t uplinkCapacityKbps;
424
425   /**
426    * Estimated downlink capacity of secondary carrier in a dual connected NR mode in kbps.
427    * This bandwidth estimate shall be the estimated maximum sustainable link bandwidth
428    * (as would be measured at the Upper PDCP or SNDCP SAP). This is valid only
429    * in if device is connected to both primary and secodary in dual connected
430    * mode. This must be filled with 0 if secondary is not connected or if
431    * modem does not support this feature.
432    */
433   uint32_t secondaryDownlinkCapacityKbps;
434
435   /**
436    * Estimated uplink capacity secondary carrier in a dual connected NR mode in kbps.
437    * This bandwidth estimate shall be the estimated
438    * maximum sustainable link bandwidth (as would be measured at the Upper PDCP or SNDCP SAP).
439    * This is valid only in if device is connected to both primary and secodary in dual connected
440    * mode.This must be filled with 0 if secondary is not connected or if modem
441    * does not support this feature.
442    */
443   uint32_t secondaryUplinkCapacityKbps;
444};
445
446enum DataThrottlingAction : int8_t {
447    /* Clear all existing data throttling. */
448    NO_DATA_THROTTLING = 0,
449
450    /**
451     * Enact secondary carrier data throttling and remove any existing data
452     * throttling on anchor carrier.
453     */
454    THROTTLE_SECONDARY_CARRIER = 1,
455
456    /**
457     * Enact anchor carrier data throttling and disable data on secondary
458     * carrier if currently enabled.
459     */
460    THROTTLE_ANCHOR_CARRIER = 2,
461
462    /**
463     * Immediately hold on to current level of throttling.
464     */
465    HOLD = 3
466};
467
468/**
469 * Defines the values for VoPS indicator of NR as per 3gpp spec 24.501 sec 9.10.3.5
470 */
471enum VopsIndicator : uint8_t {
472    /** IMS voice over PS session not supported */
473    VOPS_NOT_SUPPORTED = 0,
474    /** IMS voice over PS session supported over 3GPP access */
475    VOPS_OVER_3GPP = 1,
476    /** IMS voice over PS session supported over non-3GPP access */
477    VOPS_OVER_NON_3GPP = 2,
478};
479
480/**
481 * Defines the values for emergency service indicator of NR
482 * as per 3gpp spec 24.501 sec 9.10.3.5
483 */
484enum EmcIndicator : uint8_t {
485    /** Emergency services not supported */
486    EMC_NOT_SUPPORTED = 0,
487    /** Emergency services supported in NR connected to 5GCN only */
488    EMC_NR_CONNECTED_TO_5GCN = 1,
489    /** Emergency services supported in E-UTRA connected to 5GCN only */
490    EMC_EUTRA_CONNECTED_TO_5GCN = 2,
491    /** Emergency services supported in NR connected to 5GCN and E-UTRA connected to 5GCN */
492    EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3
493};
494
495/**
496 * Defines the values for emergency service fallback indicator of NR
497 * as per 3gpp spec 24.501 sec 9.10.3.5
498 */
499enum EmfIndicator : uint8_t {
500    /** Emergency services fallback not supported */
501    EMF_NOT_SUPPORTED = 0,
502    /** Emergency services fallback supported in NR connected to 5GCN only */
503    EMF_NR_CONNECTED_TO_5GCN = 1,
504    /** Emergency services fallback supported in E-UTRA connected to 5GCN only */
505    EMF_EUTRA_CONNECTED_TO_5GCN = 2,
506    /**
507     * Emergency services fallback supported in NR connected to 5GCN and E-UTRA
508     * connected to 5GCN.
509     */
510    EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3
511};
512
513/**
514 * Type to define the NR specific network capabilities for voice over PS including
515 * emergency and normal voice calls.
516 */
517struct NrVopsInfo {
518    /**
519     * This indicates if the camped network supports VoNR services, and what kind of services
520     * it supports. This information is received from NR network during NR NAS registration
521     * procedure through NR REGISTRATION ACCEPT.
522     * Refer 3GPP 24.501 EPS 5GS network feature support -> IMS VoPS
523     */
524    VopsIndicator vopsSupported;
525
526    /**
527     * This indicates if the camped network supports VoNR emergency service. This information
528     * is received from NR network through two sources:
529     * a. During NR NAS registration procedure through NR REGISTRATION ACCEPT.
530     *    Refer 3GPP 24.501 EPS 5GS network feature support -> EMC
531     * b. In case the device is not registered on the network.
532     *    Refer 3GPP 38.331 SIB1 : ims-EmergencySupport
533     *    If device is registered on NR, then this field indicates whether the cell
534     *    supports IMS emergency bearer services for UEs in limited service mode.
535     */
536    EmcIndicator emcSupported;
537
538    /**
539     * This indicates if the camped network supports VoNR emergency service fallback. This
540     * information is received from NR network during NR NAS registration procedure through
541     * NR REGISTRATION ACCEPT.
542     * Refer 3GPP 24.501 EPS 5GS network feature support -> EMF
543     */
544    EmfIndicator emfSupported;
545};
546
547struct LteSignalStrength {
548    @1.0::LteSignalStrength base;
549
550    /**
551     * CSI channel quality indicator (CQI) table index. There are multiple CQI tables.
552     * The definition of CQI in each table is different.
553     *
554     * Reference: 3GPP TS 136.213 section 7.2.3.
555     *
556     * Range [1, 6], INT_MAX means invalid/unreported.
557     */
558    uint32_t cqiTableIndex;
559};
560
561struct NrSignalStrength {
562    @1.4::NrSignalStrength base;
563
564    /**
565     * CSI channel quality indicator (CQI) table index. There are multiple CQI tables.
566     * The definition of CQI in each table is different.
567     *
568     * Reference: 3GPP TS 138.214 section 5.2.2.1.
569     *
570     * Range [1, 3], INT_MAX means invalid/unreported.
571     */
572    uint32_t csiCqiTableIndex;
573
574    /**
575     * CSI channel quality indicator (CQI) for all subbands.
576     *
577     * If the CQI report is for the entire wideband, a single CQI index is provided.
578     * If the CQI report is for all subbands, one CQI index is provided for each subband,
579     * in ascending order of subband index.
580     * If CQI is not available, the CQI report is empty.
581     *
582     * Reference: 3GPP TS 138.214 section 5.2.2.1.
583     *
584     * Range [0, 15], 0xFF means invalid/unreported.
585     */
586    vec<uint8_t> csiCqiReport;
587};
588
589/**
590 * Overwritten from @1.4::SignalStrength in order to update LteSignalStrength and NrSignalStrength.
591 */
592struct SignalStrength {
593    /**
594     * If GSM measurements are provided, this structure must contain valid measurements; otherwise
595     * all fields should be set to INT_MAX to mark them as invalid.
596     */
597    GsmSignalStrength gsm;
598
599    /**
600     * If CDMA measurements are provided, this structure must contain valid measurements; otherwise
601     * all fields should be set to INT_MAX to mark them as invalid.
602     */
603    CdmaSignalStrength cdma;
604
605    /**
606     * If EvDO measurements are provided, this structure must contain valid measurements; otherwise
607     * all fields should be set to INT_MAX to mark them as invalid.
608     */
609    EvdoSignalStrength evdo;
610
611    /**
612     * If LTE measurements are provided, this structure must contain valid measurements; otherwise
613     * all fields should be set to INT_MAX to mark them as invalid.
614     */
615    LteSignalStrength lte;
616
617    /**
618     * If TD-SCDMA measurements are provided, this structure must contain valid measurements;
619     * otherwise all fields should be set to INT_MAX to mark them as invalid.
620     */
621    TdscdmaSignalStrength tdscdma;
622
623    /**
624     * If WCDMA measurements are provided, this structure must contain valid measurements; otherwise
625     * all fields should be set to INT_MAX to mark them as invalid.
626     */
627    WcdmaSignalStrength wcdma;
628
629    /**
630     * If NR 5G measurements are provided, this structure must contain valid measurements; otherwise
631     * all fields should be set to INT_MAX to mark them as invalid.
632     */
633    NrSignalStrength nr;
634};
635
636/** Overwritten from @1.5::CellInfoLte in order to update LteSignalStrength. */
637struct CellInfoLte {
638    CellIdentityLte cellIdentityLte;
639    LteSignalStrength signalStrengthLte;
640};
641
642/** Overwritten from @1.5::CellInfoNr in order to update NrSignalStrength. */
643struct CellInfoNr {
644    CellIdentityNr cellIdentityNr;
645    NrSignalStrength signalStrengthNr;
646};
647
648/** Overwritten from @1.5::CellInfo in order to update LteSignalStrength and NrSignalStrength. */
649struct CellInfo {
650    /**
651     * True if this cell is registered false if not registered.
652     */
653    bool registered;
654    /**
655     * Connection status for the cell.
656     */
657    CellConnectionStatus connectionStatus;
658
659    safe_union CellInfoRatSpecificInfo {
660        /**
661         * 3gpp CellInfo types.
662         */
663        CellInfoGsm gsm;
664        CellInfoWcdma wcdma;
665        CellInfoTdscdma tdscdma;
666        CellInfoLte lte;
667        CellInfoNr nr;
668
669        /**
670         * 3gpp2 CellInfo types;
671         */
672        CellInfoCdma cdma;
673    } ratSpecificInfo;
674};
675
676/** Overwritten from @1.5::NetworkScanResult in order to update the CellInfo to 1.6 version. */
677struct NetworkScanResult {
678    /**
679     * The status of the scan.
680     */
681    ScanStatus status;
682
683    /**
684     * The error code of the incremental result.
685     */
686    RadioError error;
687
688    /**
689     * List of network information as CellInfo.
690     */
691    vec<CellInfo> networkInfos;
692};
693
694/**
695 * Overwritten from @1.5::RegStateResult to 1.6 to support NrRegistrationInfo
696 * version.
697 */
698struct RegStateResult {
699    /**
700     * Registration state
701     *
702     * If the RAT is indicated as a GERAN, UTRAN, or CDMA2000 technology, this value reports
703     * registration in the Circuit-switched domain.
704     * If the RAT is indicated as an EUTRAN, NGRAN, or another technology that does not support
705     * circuit-switched services, this value reports registration in the Packet-switched domain.
706     */
707    RegState regState;
708
709    /**
710     * Indicates the available voice radio technology, valid values as defined by RadioTechnology,
711     * except LTE_CA, which is no longer a valid value on 1.5 or above. When the device is on
712     * carrier aggregation, vendor RIL service should properly report multiple PhysicalChannelConfig
713     * elements through IRadio::currentPhysicalChannelConfigs_1_6.
714     */
715    RadioTechnology rat;
716
717    /**
718     * Cause code reported by the network in case registration fails. This will be a mobility
719     * management cause code defined for MM, GMM, MME or equivalent as appropriate for the RAT.
720     */
721    RegistrationFailCause reasonForDenial;
722
723    /** CellIdentity */
724    CellIdentity cellIdentity;
725
726    /**
727     * The most-recent PLMN-ID upon which the UE registered (or attempted to register if a failure
728     * is reported in the reasonForDenial field). This PLMN shall be in standard format consisting
729     * of a 3 digit MCC concatenated with a 2 or 3 digit MNC.
730     */
731    string registeredPlmn;
732
733    /**
734     * Access-technology-specific registration information, such as for CDMA2000.
735     */
736    safe_union AccessTechnologySpecificInfo {
737        Monostate noinit;
738
739        Cdma2000RegistrationInfo cdmaInfo;
740
741        EutranRegistrationInfo eutranInfo;
742
743        /**
744         * Network capabilities for voice over PS services. This info is valid only on NR
745         * network and must be present when the device is camped on NR. VopsInfo must be
746         * empty when the device is not camped on NR.
747         */
748        NrVopsInfo ngranNrVopsInfo;
749
750        /**
751         * True if the dual transfer mode is supported.
752         * Refer to 3GPP TS 44.108 section 3.4.25.3
753         */
754        bool geranDtmSupported;
755
756    } accessTechnologySpecificInfo;
757};
758
759struct Call {
760    @1.2::Call base;
761    /**
762     * Forwarded number. It can set only one forwarded number based on 3GPP rule of the CS.
763     * Reference: 3GPP TS 24.008 section 10.5.4.21b
764     */
765    string forwardedNumber;
766};
767
768/**
769 * This safe_union represents an optional slice info
770 */
771safe_union OptionalSliceInfo {
772    Monostate noinit;
773    SliceInfo value;
774};
775
776/**
777 * This struct represents a S-NSSAI as defined in 3GPP TS 24.501.
778 */
779struct SliceInfo {
780    /**
781     * The type of service provided by the slice.
782     *
783     * see: 3GPP TS 24.501 Section 9.11.2.8.
784     */
785    SliceServiceType sst;
786
787    /**
788     * Slice differentiator is the identifier of a slice that has
789     * SliceServiceType as SST. A value of -1 indicates that there is
790     * no corresponding SliceInfo of the HPLMN.
791     *
792     * see: 3GPP TS 24.501 Section 9.11.2.8.
793     */
794    int32_t sliceDifferentiator;
795
796    /**
797     * This SST corresponds to a SliceInfo (S-NSSAI) of the HPLMN; the SST is
798     * mapped to this value.
799     *
800     * see: 3GPP TS 24.501 Section 9.11.2.8.
801     */
802    SliceServiceType mappedHplmnSst;
803
804    /**
805     * Present only if both sliceDifferentiator and mappedHplmnSst are also
806     * present. This SD corresponds to a SliceInfo (S-NSSAI) of the HPLMN;
807     * sliceDifferentiator is mapped to this value. A value of -1 indicates that
808     * there is no corresponding SliceInfo of the HPLMN.
809     *
810     * see: 3GPP TS 24.501 Section 9.11.2.8.
811     */
812    int32_t mappedHplmnSD;
813
814    /**
815     * Field to indicate the current status of the slice.
816     */
817    SliceStatus status;
818};
819
820/**
821 * Slice/Service Type as defined in 3GPP TS 23.501.
822 */
823enum SliceServiceType : uint8_t {
824    /* Not specified */
825    NONE = 0,
826
827    /* Slice suitable for the handling of 5G enhanced Mobile Broadband */
828    EMBB = 1,
829
830    /**
831     * Slice suitable for the handling of ultra-reliable low latency
832     * communications
833     */
834    URLLC = 2,
835
836    /* Slice suitable for the handling of massive IoT */
837    MIOT = 3,
838};
839
840/**
841 * Expose more setup data call failures.
842 */
843enum DataCallFailCause : @1.4::DataCallFailCause {
844    /**
845     * Data call fail due to the slice not being allowed for the data call.
846     */
847    SLICE_REJECTED = 0x8CC,
848
849    /**
850     * No matching rule available for the request, and match-all rule is not allowed for it.
851     */
852    MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD,
853
854    /**
855     * If connection failed for all matching URSP rules.
856     */
857    ALL_MATCHING_RULES_FAILED = 0x8CE,
858};
859
860struct PhysicalChannelConfig {
861    /** Connection status for cell. Valid values are PRIMARY_SERVING and SECONDARY_SERVING */
862    CellConnectionStatus status;
863
864    /** The radio technology for this physical channel */
865    RadioTechnology rat;
866
867    /** Downlink Absolute Radio Frequency Channel Number */
868    int32_t downlinkChannelNumber;
869
870    /** Uplink Absolute Radio Frequency Channel Number */
871    int32_t uplinkChannelNumber;
872
873    /** Downlink cell bandwidth, in kHz */
874    int32_t cellBandwidthDownlinkKhz;
875
876    /** Uplink cell bandwidth, in kHz */
877    int32_t cellBandwidthUplinkKhz;
878
879    /**
880     * A list of data calls mapped to this physical channel. The context id must match the cid of
881     * @1.5::SetupDataCallResult. An empty list means the physical channel has no data call mapped
882     * to it.
883     */
884    vec<int32_t> contextIds;
885
886    /**
887     * The physical cell identifier for this cell.
888     *
889     * In UTRAN, this value is primary scrambling code. The range is [0, 511].
890     * Reference: 3GPP TS 25.213 section 5.2.2.
891     *
892     * In EUTRAN, this value is physical layer cell identity. The range is [0, 503].
893     * Reference: 3GPP TS 36.211 section 6.11.
894     *
895     * In 5G RAN, this value is physical layer cell identity. The range is [0, 1007].
896     * Reference: 3GPP TS 38.211 section 7.4.2.1.
897     */
898    uint32_t physicalCellId;
899
900    /**
901     * The frequency band to scan.
902     */
903    safe_union Band {
904        /** Valid only if radioAccessNetwork = GERAN. */
905        GeranBands geranBand;
906        /** Valid only if radioAccessNetwork = UTRAN. */
907        UtranBands utranBand;
908        /** Valid only if radioAccessNetwork = EUTRAN. */
909        EutranBands eutranBand;
910        /** Valid only if radioAccessNetwork = NGRAN. */
911        NgranBands ngranBand;
912    } band;
913};
914
915/**
916 * Extended from @1.5 NgranBands
917 * IRadio 1.6 supports NGRAN bands up to V16.5.0
918 */
919enum NgranBands  : @1.5::NgranBands {
920    /** 3GPP TS 38.101-1, Table 5.2-1: FR1 bands */
921    BAND_26 = 26,
922    BAND_46 = 46,
923    BAND_53 = 53,
924    BAND_96 = 96,
925};
926
927/**
928 * This safe_union represents an optional DNN. DNN stands for Data Network Name
929 * and represents an APN as defined in 3GPP TS 23.003.
930 */
931safe_union OptionalDnn {
932    Monostate noinit;
933    string value;
934};
935
936/**
937 * This safe_union represents an optional OsAppId.
938 */
939safe_union OptionalOsAppId {
940    Monostate noinit;
941    OsAppId value;
942};
943
944/**
945 * This safe_union represents an optional TrafficDescriptor.
946 */
947safe_union OptionalTrafficDescriptor {
948    Monostate noinit;
949    TrafficDescriptor value;
950};
951
952/**
953 * This struct represents a traffic descriptor. A valid struct must have at least
954 * one of the optional values present. This is based on the definition of traffic
955 * descriptor in TS 24.526 Section 5.2.
956 */
957struct TrafficDescriptor {
958    /**
959     * DNN stands for Data Network Name and represents an APN as defined in
960     * 3GPP TS 23.003.
961     */
962    OptionalDnn dnn;
963    /**
964     * Indicates the OsId + OsAppId (used as category in Android).
965     */
966    OptionalOsAppId osAppId;
967};
968
969/**
970 * This struct represents the OsId + OsAppId as defined in TS 24.526 Section 5.2
971 */
972struct OsAppId {
973    /**
974     * Byte array representing OsId + OsAppId. The minimum length of the array is
975     * 18 and maximum length is 272 (16 bytes for OsId + 1 byte for OsAppId length
976     * + up to 255 bytes for OsAppId).
977     */
978    vec<uint8_t> osAppId;
979};
980
981/**
982 * This struct represents the current slicing configuration.
983 */
984struct SlicingConfig {
985    /**
986     * This vector contains the current URSP rules. Empty vector represents that no
987     * rules are configured.
988     */
989    vec<UrspRule> urspRules;
990    /**
991     * List of all slices.
992     */
993    vec<SliceInfo> sliceInfo;
994};
995
996/**
997 * This struct represents a single URSP rule as defined in 3GPP TS 24.526.
998 */
999struct UrspRule {
1000    /**
1001     * Precedence value in the range of 0 to 255. Higher value has lower
1002     * precedence.
1003     */
1004    uint8_t precedence;
1005    /**
1006     * Used as a matcher for network requests.
1007     */
1008    vec<TrafficDescriptor> trafficDescriptors;
1009    /**
1010     * List of routes (connection parameters) that must be used for requests
1011     * matching a trafficDescriptor.
1012     */
1013    vec<RouteSelectionDescriptor> routeSelectionDescriptor;
1014};
1015
1016/**
1017 * This struct represents a single route selection descriptor as defined in
1018 * 3GPP TS 24.526.
1019 */
1020struct RouteSelectionDescriptor {
1021    /**
1022     * Precedence value in the range of 0 to 255. Higher value has lower
1023     * precedence.
1024     */
1025    uint8_t precedence;
1026    /**
1027     * Valid values are IP, IPV6 and IPV4V6.
1028     */
1029    OptionalPdpProtocolType sessionType;
1030    OptionalSscMode sscMode;
1031    /**
1032     * There can be 0 or more SliceInfo specified in a route descriptor.
1033     */
1034    vec<SliceInfo> sliceInfo;
1035    /**
1036     * DNN stands for Data Network Name and represents an APN as defined in
1037     * 3GPP TS 23.003. There can be 0 or more DNNs specified in a route
1038     * descriptor.
1039     */
1040    vec<string> dnn;
1041};
1042
1043/**
1044 * This safe_union represents an optional PdpProtocolType.
1045 */
1046safe_union OptionalPdpProtocolType {
1047    Monostate noinit;
1048    PdpProtocolType value;
1049};
1050
1051/**
1052 * This safe_union represents an optional SscMode.
1053 */
1054safe_union OptionalSscMode {
1055    Monostate noinit;
1056    SscMode value;
1057};
1058
1059enum SliceStatus : int8_t {
1060    UNKNOWN,
1061    CONFIGURED, // Configured but not allowed or rejected yet
1062    ALLOWED,    // Allowed to be used
1063    REJECTED_NOT_AVAILABLE_IN_PLMN,     // Rejected because not available in PLMN
1064    REJECTED_NOT_AVAILABLE_IN_REG_AREA, // Rejected because not available in reg area
1065    DEFAULT_CONFIGURED,     // Considered valid when configured/allowed slices are not available
1066};
1067
1068/**
1069 * Enum representing session and service continuity mode as defined in
1070 * 3GPP TS 23.501.
1071 */
1072enum SscMode : int8_t {
1073    MODE_1 = 1,
1074    MODE_2 = 2,
1075    MODE_3 = 3,
1076};
1077
1078/**
1079 * Public key type from carrier certificate.
1080 */
1081enum PublicKeyType : int8_t {
1082    EPDG    = 1,                   // Key type to be used for ePDG
1083    WLAN    = 2,                   // Key type to be used for WLAN
1084};
1085
1086/**
1087 * Carrier specific Information sent by the carrier,
1088 * which will be used to encrypt the IMSI and IMPI.
1089 */
1090struct ImsiEncryptionInfo {
1091    @1.1::ImsiEncryptionInfo base;
1092    PublicKeyType keyType;         // Public key type
1093};
1094
1095/**
1096 * Phonebook-record-information specified by EF_ADN(Abbreviated dialing numbers)
1097 * record of SIM as per 3GPP spec 31.102 v15 Section-4.4.2.3.
1098 */
1099struct PhonebookRecordInfo {
1100    /** Record index. 0 is used to insert a record */
1101    uint32_t recordId;
1102
1103    /** Alpha identifier, empty string if no value */
1104    string name;
1105
1106    /** Dialling number, empty string if no value */
1107    string number;
1108
1109    /** Email addresses */
1110    vec<string> emails;
1111
1112    /** Additional numbers */
1113    vec<string> additionalNumbers;
1114};
1115
1116struct PhonebookCapacity {
1117    /**
1118     * Maximum number of ADN records possible in the SIM phonebook
1119     * Needs to be non-negative
1120     */
1121    int32_t maxAdnRecords;
1122
1123    /**
1124     * Used ADN records in the SIM phonebook
1125     * Needs to be non-negative
1126     */
1127    int32_t usedAdnRecords;
1128
1129    /**
1130     * Maximum email records possible in the SIM phonebook
1131     * Needs to be non-negative
1132     */
1133    int32_t maxEmailRecords;
1134
1135    /**
1136     * Used email records in the SIM phonebook
1137     * Needs to be non-negative
1138     */
1139    int32_t usedEmailRecords;
1140
1141    /**
1142     * Maximum additional number records possible in the SIM phonebook
1143     * Needs to be non-negative
1144     */
1145    int32_t maxAdditionalNumberRecords;
1146
1147    /**
1148     * Used additional number records in the SIM phonebook
1149     * Needs to be non-negative
1150     */
1151    int32_t usedAdditionalNumberRecords;
1152
1153    /**
1154     * Maximum name length possible in the SIM phonebook
1155     * Needs to be non-negative
1156     */
1157    int32_t maxNameLen;
1158
1159    /**
1160     * Maximum number length possible in the SIM phonebook
1161     * Needs to be non-negative
1162     */
1163    int32_t maxNumberLen;
1164
1165    /**
1166     * Maximum email length possible in the SIM phonebook
1167     * Needs to be non-negative
1168     */
1169    int32_t maxEmailLen;
1170
1171    /**
1172     * Maximum additional number length possible in the SIM phonebook
1173     * Needs to be non-negative
1174     */
1175    int32_t maxAdditionalNumberLen;
1176};
1177
1178/**
1179 * Enum representing the status of the received PB indication,
1180 * PB_RECEIVED_OK indicates this retrieval is fine
1181 * PB_RECEIVED_ERROR indicates one error happens, in general, the process
1182 *   can't be restored soon.
1183 * PB_RECEIVED_ABORT indicates the process is interrupted, in this case,
1184 *   modem might need resources and interrupt the current process, or it is
1185 *   timed out to receive all indications, and client can retry soon.
1186 * PB_RECEIVED_FINAL indicates the whole process is finished with a full
1187 *   chunk of phonebook data, means this is a last indication with the left
1188 *   data.
1189 */
1190enum PbReceivedStatus : int8_t {
1191    PB_RECEIVED_OK = 1,
1192    PB_RECEIVED_ERROR = 2,
1193    PB_RECEIVED_ABORT = 3,
1194    PB_RECEIVED_FINAL = 4,
1195};
1196
1197