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