+EXPORT_API int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.PdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.RoamPdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+