Commit Graph

35 Commits

Author SHA1 Message Date
Aleksander Morgado
bf2843ad77 libmm-glib: separate files for flags and enums types
This allows us to skip needing to include the non-existent
build_string_from_mask() or get_string() counterparts in the
documentation index.
2023-04-27 12:23:04 +00:00
Aleksander Morgado
46af452487 libmm-glib,bearer-properties: new print() method 2022-11-04 13:12:56 +00:00
Andrew Lassalle
9793378870 bearer-properties: Match UNKNOWN auth to CHAP for loose comparison
MBIM and QMI fallback to CHAP when a username or password is present
but no authentication type was provided. Consider CHAP==UNKNOWN when
using loose comparison.
2022-03-29 16:01:30 +00:00
Aleksander Morgado
f6a91b2250 libmm-glib: new 'roaming-allowance' in 3GPP profile and bearer properties 2021-12-24 14:03:15 +01:00
Aleksander Morgado
e61fd7ca58 libmm-glib: new 'access-type-preference' in 3GPP profile and bearer properties 2021-12-24 14:03:13 +01:00
Aleksander Morgado
21c775703c libmm-glib: fix license in sources
The libmm-glib library is LGPLv2+, not GPLv2+.
2021-11-16 17:54:26 +01:00
Andrew Lassalle
c355210f5d bearer-properties: Add profile-name to the bearer properties 2021-10-17 17:56:44 +02:00
Aleksander Morgado
febd5778e7 libmm-glib,bearer-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado
a325acd6b1 libmm-glib: remove unused cmp_allow_roaming() method
mm-bearer-properties.c:725:1: warning: 'cmp_allow_roaming' defined but not used [-Wunused-function]
   cmp_allow_roaming (gboolean                   a,
   ^~~~~~~~~~~~~~~~~
2021-05-18 14:51:05 +02:00
Aleksander Morgado
793370f2f8 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.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
ff8e21b535 api,bearer: new 'apn-type' setting
This new setting allows the user setting up the connection to specify
the purpose of the connection being brought up.

Until now, we would always assume that connections are exclusively
brought up for connecting to the Internet, also limited by the
inability to connect to multiple different APNs at the same time.

But that may really not be true as there may be additional services
that may be accessed through other APNs, like MMS services or even
private networks for companies that have their own APNs on a given
operator (e.g. not that uncommon with banks and connected cars).

The new APN type setting will not change the way the bearer is
connected, but will allow the connection manager to decide what kind
of networking setup the specific connection needs.

This new setting can be provided by the user itself, or implicitly
read from the device if the device stores this information.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
3d665d2209 libmm-glib,bearer-properties: fix usage of CMP_FLAGS_NO_RM_PROTOCOL 2021-04-09 00:53:12 +02:00
Aleksander Morgado
4b19b9693f libmm-glib,bearer-properties: fix 'allowed-auth' comparison 2021-03-24 11:00:22 +01:00
Aleksander Morgado
064e92e9b7 api,simple: new 'multiplex' setting in bearer properties
Both the Simple.Connect() and Modem.CreateBearer() are updated to
allow a new 'multiplex' setting in the properties provided by the user
in both of these methods.

The new setting expects a MMBearerMultiplexSupport enum indicating
what kind of multiplex needs the user has:
 * none: if multiplex must not be used.
 * requested: if multiplex should be used if available.
 * required: if multiplex must be used.

The underlying implementations will take care of accepting or
rejecting the setting depending on the system and modem capabilities.
2021-03-10 10:59:19 +01:00
Aleksander Morgado
f10e4af919 libmm-glib,bearer-properties: fix 'allow roaming' comparison
Fix the 'allow roaming' setting comparison, which was breaking the
whole bearer properties comparison logic, and therefore making
Simple.Connect() recreate over and over the bearer with the same
settings.

Fixes 5629f47a59
2021-02-25 15:23:36 +01:00
Aleksander Morgado
c4f215c9cb libmm-glib,bearer-properties: consume 'rm-protocol' setting 2021-02-17 23:40:59 +01:00
Aleksander Morgado
5629f47a59 libmm-glib,bearer-properties: allow loose comparisons
When comparing bearer properties provided by the user versus loaded
from the modem, we shouldn't be very strict, e.g.:
 * Password or other fields may not be readable from the device.
 * Some fields may not apply at all (e.g. RM protocol for EPS bearers)
 * NULL strings could be assumed equal to empty strings.
 * If no explicit IP type specified, an IPv4 default may be assumed.
 * If no explicit allowed auth specified, 'none' default may be
   assumed.

These loose comparisons are applied when managing the initial EPS
bearer settings and status, and we keep the strict comparison only
during the connection attempt lookup of a bearer with certain
settings, as those bearer objects are all created in the same place
with the same rules.
2020-12-21 12:05:57 +00:00
Aleksander Morgado
baa68f5a4a libmm-glib,simple-connect-properties: cleaner error handling
If processing a key-value pair as a bearer property fails, we need to
know if it failed due to the key being unknown or due to some other
reason (e.g. failure parsing value of a known key).

We'll only try with the Simple.Connect properties if the key is
reported as unknown in the bearer properties.

This will help us better identify errors if e.g. an invalid value is
given to a known key. E.g. "yes" was invalid for allow-roaming here:

    daemon.notice netifd: wan (30476): simple connect=apn=internet,ip-type=ipv4,allow-roaming=yes
    daemon.notice netifd: wan (30476): Error parsing connect string: 'Invalid properties string, unexpected key 'allow-roaming''
2020-01-06 14:46:36 +01:00
Aleksander Morgado
5dd829174f libmm-glib: flag as (skip) all non-API methods
So that the GI scanner ignores them.
2019-10-28 10:28:31 +01:00
Aleksander Morgado
651028c2b7 libmm-glib: remove unused _dup() methods 2019-10-28 10:28:31 +01:00
Aleksander Morgado
08d23dd64d docs,libmm-glib: provide per-version indices 2019-10-28 10:28:31 +01:00
Aleksander Morgado
55c3026643 api: deprecate 'number' in bearer properties
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/99
2019-01-03 16:42:18 +00:00
Aleksander Morgado
8b8bc0773f libmm-glib,bearer-properties: don't document non-public API
To avoid gtk-doc complaining about that.
2018-11-12 12:22:24 +01:00
Aleksander Morgado
1481dd58e2 libmm-glib,bearer-properties: minor documentation typo fix 2018-03-13 12:41:47 +01:00
Ville Skyttä
90b89bb9f4 *: Spelling fixes 2018-01-25 09:52:12 +01:00
Aleksander Morgado
707a2ef417 libmm-glib,docs: fix missing documentations 2015-08-02 12:05:51 +02:00
Christian Persch
0abba497ab libmm-glib: Fix and add introspection annotations
Bug #705641.
2013-08-14 13:30:35 +02:00
Aleksander Morgado
804642adc2 api: let MMBearerIpFamily be flags instead of a enumeration
We want to expose in the Modem interface the list of supported IP families, and
the easiest way to do so is to have the IP family as flags, and provide in the
interface a single enum.

Also, a value of 0 for a MMBearerIpFamily specifies that no flags are set, so
just rename it to 'NONE'.

And add a new 'ANY' value which sets all flags to 1.
2013-06-05 19:15:13 +02:00
Ben Chan
4ac3a6d4f2 bearer: allow specifying default IP family for bearers
This patch adds a 'bearer-default-ip-family' property to MMBearer, which
specifies the default IP family to use for a bearer when no explicit
value is given via the simple connect properties. The default IP family
is set to IPv4 in MMBearer but can be overridden by a MMBearer subclass,
which allows a modem plugin to specify an appropriate default value.
2013-04-23 15:25:48 +02:00
Aleksander Morgado
ebd792d2aa api,libmm-glib: new `allowed-auth' configuration for bearers
For bearers using STATIC or DHCP IP method, the modem itself is the one
negotiating authentication with the network. The new `allowed-auth' property
allows users to specify which authentication method(s) are allowed to be used.

See the following NetworkManager commit for more reference:
    commit 34aef8aaaa09b7473b9496aa49e550bd2def03f8
    Author: Andrew Bird <ajb@spheresystems.co.uk>
    Date:   Thu Mar 15 16:19:43 2012 -0500
2012-10-07 21:12:00 +02:00
Aleksander Morgado
52f457bb88 libmm-glib,bearer-properties: improve documentation 2012-10-04 10:17:12 +02:00
Aleksander Morgado
b6d628b3a1 build: merge libmm-common into libmm-glib
It's pointless to have libmm-common around, just merge it into libmm-glib and
make ModemManager depend on libmm-glib directly. At the end, the non-common
stuff in libmm-glib is really minimal.
2012-10-04 10:17:05 +02:00
Aleksander Morgado
d306bb082f libmm-common: `MMBearerProperties' won't be considered internal any more
Renamed `MMCommonBearerProperties' to `MMBearerProperties', and removed the
`MMBearerProperties' provided in libmm-glib. We'll just use the original one
from libmm-common always.
2012-03-16 14:53:19 +01:00
Aleksander Morgado
014a9eddab libmm-glib: allow passing Rm protocol to bearer properties 2012-03-15 14:14:47 +01:00
Aleksander Morgado
fe7f71b677 libmm-common,libmm-glib: new object to handle bearer creation properties 2012-03-15 14:14:38 +01:00