api,bearer: new 'BearerType' property

Until now we have only allowed to use and setup 'default bearers' (in
4G) or 'primary contexts' (in 2G/3G).

We can define a couple of additional bearer types, though:

* The 'dedicated bearers' (in 4G) or 'secondary contexts' (in 2G/3G),
  which are associated to a specific default/primary one, but which
  provide specific QoS settings configured via traffic flow templates.

* The 'initial default EPS bearer', which is a special case of default
  bearer in LTE, which is automatically created and connected when the
  modem is registered in the LTE network.

This commit introduces a new 'MMBearerType' enumeration that will be
associated to each bearer through a 'BearerType' property in the
org.freedesktop.ModemManager1.Bearer interface, showing what kind of
bearer/context this is.

By default, right now, all bearer objects created are 'default'
bearers.
This commit is contained in:
Aleksander Morgado
2018-12-07 16:20:53 +00:00
committed by Dan Williams
parent 46d627ff83
commit dc154cf005
11 changed files with 80 additions and 17 deletions
+18
View File
@@ -204,6 +204,24 @@ mm_bearer_get_ip_timeout (MMBearer *self)
/*****************************************************************************/
/**
* mm_bearer_get_bearer_type:
* @self: A #MMBearer.
*
* Gets the type of bearer.
*
* Returns: a #MMBearerType.
*/
MMBearerType
mm_bearer_get_bearer_type (MMBearer *self)
{
g_return_val_if_fail (MM_IS_BEARER (self), MM_BEARER_TYPE_UNKNOWN);
return mm_gdbus_bearer_get_bearer_type (MM_GDBUS_BEARER (self));
}
/*****************************************************************************/
static void
ipv4_config_updated (MMBearer *self,
GParamSpec *pspec)
+9 -7
View File
@@ -67,17 +67,19 @@ struct _MMBearerClass {
GType mm_bearer_get_type (void);
const gchar *mm_bearer_get_path (MMBearer *self);
gchar *mm_bearer_dup_path (MMBearer *self);
const gchar *mm_bearer_get_path (MMBearer *self);
gchar *mm_bearer_dup_path (MMBearer *self);
const gchar *mm_bearer_get_interface (MMBearer *self);
gchar *mm_bearer_dup_interface (MMBearer *self);
const gchar *mm_bearer_get_interface (MMBearer *self);
gchar *mm_bearer_dup_interface (MMBearer *self);
gboolean mm_bearer_get_connected (MMBearer *self);
gboolean mm_bearer_get_connected (MMBearer *self);
gboolean mm_bearer_get_suspended (MMBearer *self);
gboolean mm_bearer_get_suspended (MMBearer *self);
guint mm_bearer_get_ip_timeout (MMBearer *self);
guint mm_bearer_get_ip_timeout (MMBearer *self);
MMBearerType mm_bearer_get_bearer_type (MMBearer *self);
void mm_bearer_connect (MMBearer *self,
GCancellable *cancellable,