diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-04 13:31:28 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-29 10:13:22 +0000 |
commit | 793370f2f8efc6472d7265892013f6615188344e (patch) | |
tree | 7b6f881bd8517938f2838b11c77e73da077d8793 /cli | |
parent | e2789b18a1847eecd90fe76902300d99c4ebade3 (diff) |
api,bearer: new 'profile-id' setting
We define a new 'profile-id' setting in the bearer properties that
users will use to specify which connection profile of the ones
available in the device should be connected.
When the 'profile-id' is given, the associated bearer object will be
bound to the 'profile-id', and the user is able to provide additional
settings to apply on top (e.g. if the profile storage doesn't allow
some of the settings we support, like 'apn-type', or if the setting is
completely unrelated to profiles, like 'multiplex').
After introducing the 'profile-id' as a valid setting in the bearer
properties, we also reimplement the properties object internals to
make use a 3GPP profile for the subset of common settings between both
objects.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/mmcli-bearer.c | 14 | ||||
-rw-r--r-- | cli/mmcli-output.c | 1 | ||||
-rw-r--r-- | cli/mmcli-output.h | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c index 913b6780..8dbcece5 100644 --- a/cli/mmcli-bearer.c +++ b/cli/mmcli-bearer.c @@ -162,12 +162,19 @@ print_bearer_info (MMBearer *bearer) const gchar *password = NULL; const gchar *rm_protocol = NULL; gchar *allowed_auth_str = NULL; + gchar *properties_profile_id_str = NULL; if (properties) { + gint properties_profile_id; + + properties_profile_id = mm_bearer_properties_get_profile_id (properties); + if (properties_profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) + properties_profile_id_str = g_strdup_printf ("%d", properties_profile_id); + apn = mm_bearer_properties_get_apn (properties); - apn_type_str = (properties ? mm_bearer_apn_type_build_string_from_mask (mm_bearer_properties_get_apn_type (properties)) : NULL); - ip_family_str = (properties ? mm_bearer_ip_family_build_string_from_mask (mm_bearer_properties_get_ip_type (properties)) : NULL); - allowed_auth_str = (properties ? mm_bearer_allowed_auth_build_string_from_mask (mm_bearer_properties_get_allowed_auth (properties)) : NULL); + apn_type_str = mm_bearer_apn_type_build_string_from_mask (mm_bearer_properties_get_apn_type (properties)); + ip_family_str = mm_bearer_ip_family_build_string_from_mask (mm_bearer_properties_get_ip_type (properties)); + allowed_auth_str = mm_bearer_allowed_auth_build_string_from_mask (mm_bearer_properties_get_allowed_auth (properties)); user = mm_bearer_properties_get_user (properties); password = mm_bearer_properties_get_password (properties); if (mm_bearer_get_bearer_type (bearer) != MM_BEARER_TYPE_DEFAULT_ATTACH) { @@ -176,6 +183,7 @@ print_bearer_info (MMBearer *bearer) } } + mmcli_output_string_take (MMC_F_BEARER_PROPERTIES_PROFILE_ID, properties_profile_id_str); mmcli_output_string (MMC_F_BEARER_PROPERTIES_APN, apn); mmcli_output_string_take (MMC_F_BEARER_PROPERTIES_APN_TYPE, apn_type_str); mmcli_output_string (MMC_F_BEARER_PROPERTIES_ROAMING, roaming); diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c index 69448562..38d31c4e 100644 --- a/cli/mmcli-output.c +++ b/cli/mmcli-output.c @@ -218,6 +218,7 @@ static FieldInfo field_infos[] = { [MMC_F_BEARER_PROPERTIES_ALLOWED_AUTH] = { "bearer.properties.allowed-auth", "allowed-auth", MMC_S_BEARER_PROPERTIES, }, [MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, }, [MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, }, + [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_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, }, diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h index faf8abbe..088cc35a 100644 --- a/cli/mmcli-output.h +++ b/cli/mmcli-output.h @@ -235,6 +235,7 @@ typedef enum { MMC_F_BEARER_PROPERTIES_ALLOWED_AUTH, MMC_F_BEARER_PROPERTIES_USER, MMC_F_BEARER_PROPERTIES_PASSWORD, + MMC_F_BEARER_PROPERTIES_PROFILE_ID, MMC_F_BEARER_PROPERTIES_NUMBER, MMC_F_BEARER_PROPERTIES_RM_PROTOCOL, MMC_F_BEARER_IPV4_CONFIG_METHOD, |