diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-11-26 15:26:05 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-12-24 14:03:15 +0100 |
commit | f6a91b2250203e0f11f1d9dde9e8f9963e5c62a4 (patch) | |
tree | 479e867aad27f42a8c08ae953490508eb7c80a27 /libmm-glib/mm-3gpp-profile.c | |
parent | 24e634229d27cd9743c5c5cfa3e6cedd98bf1379 (diff) |
libmm-glib: new 'roaming-allowance' in 3GPP profile and bearer properties
Diffstat (limited to 'libmm-glib/mm-3gpp-profile.c')
-rw-r--r-- | libmm-glib/mm-3gpp-profile.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libmm-glib/mm-3gpp-profile.c b/libmm-glib/mm-3gpp-profile.c index eca2f7e0..b9c66fce 100644 --- a/libmm-glib/mm-3gpp-profile.c +++ b/libmm-glib/mm-3gpp-profile.c @@ -47,6 +47,7 @@ G_DEFINE_TYPE (MM3gppProfile, mm_3gpp_profile, G_TYPE_OBJECT) #define PROPERTY_APN_TYPE "apn-type" #define PROPERTY_ACCESS_TYPE_PREFERENCE "access-type-preference" #define PROPERTY_ENABLED "profile-enabled" +#define PROPERTY_ROAMING_ALLOWANCE "roaming-allowance" struct _MM3gppProfilePrivate { gint profile_id; @@ -57,6 +58,7 @@ struct _MM3gppProfilePrivate { MMBearerAccessTypePreference access_type_preference; gboolean enabled; gboolean enabled_set; + MMBearerRoamingAllowance roaming_allowance; /* Optional authentication settings */ MMBearerAllowedAuth allowed_auth; @@ -118,6 +120,9 @@ mm_3gpp_profile_cmp (MM3gppProfile *a, if (!(flags & MM_3GPP_PROFILE_CMP_FLAGS_NO_ENABLED) && ((a->priv->enabled != b->priv->enabled) || (a->priv->enabled_set != b->priv->enabled_set))) return FALSE; + if (!(flags & MM_3GPP_PROFILE_CMP_FLAGS_NO_ROAMING_ALLOWANCE) && + (a->priv->roaming_allowance != b->priv->roaming_allowance)) + return FALSE; return TRUE; } @@ -519,6 +524,44 @@ mm_3gpp_profile_get_enabled (MM3gppProfile *self) /*****************************************************************************/ /** + * mm_3gpp_profile_set_roaming_allowance: + * @self: a #MM3gppProfile. + * @roaming_allowance: a mask of #MMBearerRoamingAllowance values. + * + * Sets the roaming allowance rules. + * + * Since: 1.20 + */ +void +mm_3gpp_profile_set_roaming_allowance (MM3gppProfile *self, + MMBearerRoamingAllowance roaming_allowance) +{ + g_return_if_fail (MM_IS_3GPP_PROFILE (self)); + + self->priv->roaming_allowance = roaming_allowance; +} + +/** + * mm_3gpp_profile_get_roaming_allowance: + * @self: a #MM3gppProfile. + * + * Gets the roaming allowance rules. + * + * Returns: a mask of #MMBearerRoamingAllowance values. + * + * Since: 1.20 + */ +MMBearerRoamingAllowance +mm_3gpp_profile_get_roaming_allowance (MM3gppProfile *self) +{ + g_return_val_if_fail (MM_IS_3GPP_PROFILE (self), MM_BEARER_ROAMING_ALLOWANCE_NONE); + + return self->priv->roaming_allowance; +} + +/*****************************************************************************/ + +/** * mm_3gpp_profile_get_dictionary: (skip) */ GVariant * @@ -865,6 +908,7 @@ mm_3gpp_profile_init (MM3gppProfile *self) self->priv->apn_type = MM_BEARER_APN_TYPE_NONE; self->priv->access_type_preference = MM_BEARER_ACCESS_TYPE_PREFERENCE_NONE; self->priv->enabled = TRUE; + self->priv->roaming_allowance = MM_BEARER_ROAMING_ALLOWANCE_NONE; } static void |