• 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 struct SetupDataCallResultInfo : public HrilBaseParcel {
24     int32_t flag;
25     int32_t reason; /* Data call fail reason. success is 0 */
26     int32_t retryTime; /* if errorCode != 0, suggested retry time */
27     int32_t cid; /* from 3GPP TS 27.007 V17.3.0 (2021-09)
28                   * specifies a particular PDP context definition. The parameter is local to the TE-MT interface
29                   * and is used in other PDP context-related commands. */
30     int32_t active; /* from 3GPP TS 27.007 V17.3.0 (2021-09)
31                      * indicates the state of PDP context activation
32                      * 0 - deactivated
33                      * 1 - activated */
34     std::string type; /* PDP_type values from 3GPP TS 27.007 V17.3.0 (2021-09)
35                        * specifies the type of packet data protocol. The default value is manufacturer specific. */
36     std::string netPortName; /* Network interface name */
37     std::string address; /* from 3GPP TS 27.007 V17.3.0 (2021-09)
38                           * <local_addr and subnet_mask>: string type;
39                           * shows the IP address and subnet mask of the MT. The string is given as dot-separated
40                           * numeric (0-255) parameters on the form: "a1.a2.a3.a4.m1.m2.m3.m4" for IPv4 or
41                           * "a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16.
42                           * m1.m2.m3.m4.m5.m6.m7.m8.m9.m10.m11.m12.m13.m14.m15.m16" for IPv6.
43                           * When +CGPIAF is supported, its settings can influence the format of this parameter
44                           * returned with the execute form of +CGCONTRDP */
45     std::string dns; /* If the MT indicates more than two IP addresses of P-CSCF servers
46                       * string type; shows the IP address of the secondary DNS server.When +CGPIAF is supported, its
47                       * settings can influence the format of this parameter returned with the execute form of
48                       * +CGCONTRDP. */
49     std::string dnsSec; /* from 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12)
50                          * string type; shows the IP address of the secondary DNS server.When +CGPIAF is supported,
51                          * its settings can influence the format of this parameter returned with the execute form of
52                          * +CGCONTRDP. */
53     std::string gateway; /* network gateway address */
54     int32_t maxTransferUnit; /* Maximum Transfer Unit. The range of permitted values (minimum value = 1
55                               * or if the initial PDP context is supported minimum value = 0)
56                               * is returned by the test form of the command. */
57     std::string pCscfPrimAddr; /* from 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12)
58                                 * string type; shows the IP address of the primary P-CSCF server.When +CGPIAF is
59                                 * supported, its settings can influence the format of this parameter returned with
60                                 * the execute form of +CGCONTRDP. */
61     std::string pCscfSecAddr; /* from 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12)
62                                * string type; shows the IP address of the secondary P-CSCF server. When +CGPIAF is
63                                * supported, its settings can influence the format of this parameter returned with the
64                                * execute form of +CGCONTRDP. */
65     int32_t pduSessionId; /* from 3GPP TS 27.007 10.1.23 V4.3.0 (2001-12)
66                            * integer type; identifies the PDU session, see 3GPP TS 24.501 [161]. */
67     bool ReadFromParcel(Parcel &parcel);
68     virtual bool Marshalling(Parcel &parcel) const override;
69     std::shared_ptr<SetupDataCallResultInfo> UnMarshalling(Parcel &parcel);
70     void Dump(std::string, int32_t);
71 };
72 
73 struct DataCallResultList : public HrilBaseParcel {
74     int32_t size; /* Size of DataCall List */
75     std::vector<SetupDataCallResultInfo> dcList; /* DataCall List */
76 
77     bool ReadFromParcel(Parcel &parcel);
78     virtual bool Marshalling(Parcel &parcel) const override;
79     std::shared_ptr<DataCallResultList> UnMarshalling(Parcel &parcel);
80     void Dump(std::string, int32_t);
81 };
82 
83 /* from 3GPP TS 27.007 10.1 V4.3.0 (2001-12) */
84 struct DataProfileDataInfo : public HrilBaseParcel {
85     int32_t serial;
86     int32_t profileId; /* Id of data profiles */
87     std::string apn; /* (Access Point Name) a string parameter
88                       * which is a logical name that is used to select the GGSN or the */
89     std::string protocol; /* (Packet Data Protocol type) a string parameter which
90                            * specifies the type of packet data protocol */
91     std::string roamingProtocol;
92     int32_t verType; /* APN verification type */
93     std::string userName;
94     std::string password;
95 
96     bool ReadFromParcel(Parcel &parcel);
97     virtual bool Marshalling(Parcel &parcel) const override;
98     std::shared_ptr<DataProfileDataInfo> UnMarshalling(Parcel &parcel);
99     void Dump(std::string, int32_t);
100 };
101 
102 struct DataProfilesInfo : public HrilBaseParcel {
103     int32_t serial;
104     int32_t profilesSize;
105     std::vector<DataProfileDataInfo> profiles;
106     bool isRoaming;
107 
108     bool ReadFromParcel(Parcel &parcel);
109     virtual bool Marshalling(Parcel &parcel) const override;
110     std::shared_ptr<DataProfilesInfo> UnMarshalling(Parcel &parcel);
111     void Dump(std::string, int32_t);
112 };
113 
114 struct DataCallInfo : public HrilBaseParcel {
115     int32_t serial;
116     int32_t radioTechnology; /* Voice radio technology */
117     DataProfileDataInfo dataProfileInfo;
118     bool modemCognitive; /* 1: APN setting setDataProfile. 0: no */
119     bool roamingAllowed;
120     bool isRoaming;
121 
122     bool ReadFromParcel(Parcel &parcel);
123     virtual bool Marshalling(Parcel &parcel) const override;
124     std::shared_ptr<DataCallInfo> UnMarshalling(Parcel &parcel);
125     void Dump(std::string, int32_t);
126 };
127 
128 struct DataLinkBandwidthInfo : public HrilBaseParcel {
129     int32_t serial;
130     int32_t cid; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
131                   * integer type; specifies a particular QoS flow definition, Traffic Flows
132                   * definition and a PDP Context definition (see the +CGDCONT and +CGDSCONT commands). */
133     int32_t qi; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
134                  * 0 5QI is selected by network
135                  * [1 - 4]	value range for guaranteed bit rate QoS flows
136                  * 65, 66, 67 values for guaranteed bit rate QoS flows
137                  * [71 - 76] value range for guaranteed bit rate QoS flows
138                  * [5 - 9] value range for non-guaranteed bit rate QoS flows
139                  * 69, 70, 79, 80 values for non-guaranteed bit rate QoS flows
140                  * [82 - 85] value range for delay critical guaranteed bit rate QoS flows
141                  * [128 - 254] value range for Operator-specific 5QIs */
142     int32_t dlGfbr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
143                      * integer type; indicates DL GFBR in case of GBR 5QI. The value is in kbit/s. This parameter is
144                      * omitted for a non-GBR 5QI (see 3GPP TS 24.501 [161]) */
145     int32_t ulGfbr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
146                      * integer type; indicates UL GFBR in case of GBR 5QI. The value is in kbit/s. This parameter is
147                      * omitted for a non-GBR 5QI (see 3GPP TS 24.501 [161]). */
148     int32_t dlMfbr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
149                      * integer type; indicates DL MFBR in case of GBR 5QI. The value is in kbit/s. This parameter is
150                      * omitted for a non-GBR 5QI (see 3GPP TS 24.501 [161]). */
151     int32_t ulMfbr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
152                      * integer type; indicates UL MFBR in case of GBR 5QI. The value is in kbit/s. This parameter is
153                      * omitted for a non-GBR 5QI (see 3GPP TS 24.501 [161]). */
154     int32_t ulSambr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
155                       * integer type; indicates the UL session AMBR(see 3GPP TS 24.501 [161]).
156                       * The value is in kbit /s. */
157     int32_t dlSambr; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
158                       * integer type; indicates the DL session AMBR(see 3GPP TS 24.501 [161]).
159                       * The value is in kbit/ s. */
160     int32_t averagingWindow; /* from 3GPP TS 27.007 10.1.50 V4.3.0 (2021-10)
161                               * integer type; indicates the averaging window(see 3GPP TS 24.501 [161]) .The value is
162                               * in milliseconds. */
163 
164     bool ReadFromParcel(Parcel &parcel);
165     virtual bool Marshalling(Parcel &parcel) const override;
166     std::shared_ptr<DataLinkBandwidthInfo> UnMarshalling(Parcel &parcel);
167     void Dump(std::string, int32_t);
168 };
169 
170 struct DataLinkBandwidthReportingRule : public HrilBaseParcel {
171     int32_t serial;
172     int32_t rat;
173     int32_t delayMs;
174     int32_t delayUplinkKbps;
175     int32_t delayDownlinkKbps;
176     int32_t maximumUplinkKbpsSize;
177     int32_t maximumDownlinkKbpsSize;
178     std::vector<int32_t> maximumUplinkKbps;
179     std::vector<int32_t> maximumDownlinkKbps;
180 
181     bool ReadFromParcel(Parcel &parcel);
182     virtual bool Marshalling(Parcel &parcel) const override;
183     std::shared_ptr<DataLinkBandwidthReportingRule> UnMarshalling(Parcel &parcel);
184     void Dump(std::string, int32_t);
185 };
186 } // namespace Telephony
187 } // namespace OHOS
188 #endif // OHOS_RIL_DATA_PARCEL_H
189