cli: new 'access-type-preference' in 3GPP profile and bearer properties

This commit is contained in:
Aleksander Morgado
2021-11-26 12:31:07 +01:00
parent 50fc0101f5
commit 41887b3fb7
3 changed files with 254 additions and 235 deletions

View File

@@ -173,6 +173,7 @@ print_bearer_info (MMBearer *bearer)
const gchar *rm_protocol = NULL;
gchar *allowed_auth_str = NULL;
gchar *properties_profile_id_str = NULL;
const gchar *access_type_preference_str = NULL;
if (properties) {
gint properties_profile_id;
@@ -191,6 +192,7 @@ print_bearer_info (MMBearer *bearer)
roaming = mm_bearer_properties_get_allow_roaming (properties) ? "allowed" : "forbidden";
rm_protocol = mm_modem_cdma_rm_protocol_get_string (mm_bearer_properties_get_rm_protocol (properties));
}
access_type_preference_str = mm_bearer_access_type_preference_get_string (mm_bearer_properties_get_access_type_preference (properties));
}
mmcli_output_string_take (MMC_F_BEARER_PROPERTIES_PROFILE_ID, properties_profile_id_str);
@@ -202,6 +204,7 @@ print_bearer_info (MMBearer *bearer)
mmcli_output_string (MMC_F_BEARER_PROPERTIES_PASSWORD, password);
mmcli_output_string (MMC_F_BEARER_PROPERTIES_RM_PROTOCOL, rm_protocol);
mmcli_output_string_list_take (MMC_F_BEARER_PROPERTIES_ALLOWED_AUTH, allowed_auth_str);
mmcli_output_string (MMC_F_BEARER_PROPERTIES_ACCESS_TYPE_PREFERENCE, access_type_preference_str);
}
/* IPv4 config */

View File

@@ -240,6 +240,7 @@ static FieldInfo field_infos[] = {
[MMC_F_BEARER_PROPERTIES_PROFILE_ID] = { "bearer.properties.profile-id", "profile id", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ACCESS_TYPE_PREFERENCE] = { "bearer.properties.access-type-preference", "access type preference", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, },
@@ -929,6 +930,7 @@ build_profile_human (GPtrArray *array,
MMBearerAllowedAuth allowed_auth;
MMBearerIpFamily ip_type;
MMBearerApnType apn_type;
MMBearerAccessTypePreference access_type_preference;
g_ptr_array_add (array, g_strdup_printf ("profile-id: %u", mm_3gpp_profile_get_profile_id (profile)));
@@ -967,6 +969,12 @@ build_profile_human (GPtrArray *array,
apn_type_str = mm_bearer_apn_type_build_string_from_mask (apn_type);
g_ptr_array_add (array, g_strdup_printf (" apn-type: %s", apn_type_str));
}
access_type_preference = mm_3gpp_profile_get_access_type_preference (profile);
if (access_type_preference != MM_BEARER_ACCESS_TYPE_PREFERENCE_NONE) {
aux = mm_bearer_access_type_preference_get_string (access_type_preference);
g_ptr_array_add (array, g_strdup_printf (" access type preference: %s", aux));
}
}
static void
@@ -978,6 +986,7 @@ build_profile_keyvalue (GPtrArray *array,
MMBearerAllowedAuth allowed_auth;
MMBearerIpFamily ip_type;
MMBearerApnType apn_type;
MMBearerAccessTypePreference access_type_preference;
str = g_string_new ("");
g_string_append_printf (str, "profile-id: %u", mm_3gpp_profile_get_profile_id (profile));
@@ -1018,6 +1027,12 @@ build_profile_keyvalue (GPtrArray *array,
g_string_append_printf (str, ", apn-type: %s", apn_type_str);
}
access_type_preference = mm_3gpp_profile_get_access_type_preference (profile);
if (access_type_preference != MM_BEARER_ACCESS_TYPE_PREFERENCE_NONE) {
aux = mm_bearer_access_type_preference_get_string (access_type_preference);
g_string_append_printf (str, ", access-type-preference: %s", aux);
}
g_ptr_array_add (array, g_string_free (str, FALSE));
}

View File

@@ -258,6 +258,7 @@ typedef enum {
MMC_F_BEARER_PROPERTIES_PROFILE_ID,
MMC_F_BEARER_PROPERTIES_NUMBER,
MMC_F_BEARER_PROPERTIES_RM_PROTOCOL,
MMC_F_BEARER_PROPERTIES_ACCESS_TYPE_PREFERENCE,
MMC_F_BEARER_IPV4_CONFIG_METHOD,
MMC_F_BEARER_IPV4_CONFIG_ADDRESS,
MMC_F_BEARER_IPV4_CONFIG_PREFIX,