summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-02-20 15:25:42 +0100
committerThomas Haller <thaller@redhat.com>2023-02-20 15:25:42 +0100
commita1cdec78940558eb76ac117c2d4b5900b81980b8 (patch)
tree13c1c0dc675b07c3c4f1960b543228f23abb5501
parenta839395e302989d1d5557d206c7df1b54c9e8767 (diff)
parentc52999ee909a97aeaf2b577411249428ff88d447 (diff)
downloadNetworkManager-a1cdec78940558eb76ac117c2d4b5900b81980b8.tar.gz
gsm: merge branch 'svenschwermer:initial-eps-bearer'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1331
-rw-r--r--src/core/devices/wwan/nm-modem-broadband.c75
-rw-r--r--src/core/devices/wwan/nm-modem.c31
-rw-r--r--src/core/devices/wwan/nm-modem.h2
-rw-r--r--src/libnm-client-impl/libnm.ver2
-rw-r--r--src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in8
-rw-r--r--src/libnm-core-impl/nm-setting-gsm.c186
-rw-r--r--src/libnm-core-public/nm-setting-gsm.h32
-rw-r--r--src/libnmc-setting/nm-meta-setting-desc.c6
-rw-r--r--src/libnmc-setting/settings-docs.h.in2
-rw-r--r--src/nmcli/gen-metadata-nm-settings-nmcli.xml.in4
-rw-r--r--src/tests/client/test-client.check-on-disk/test_003.expected72
11 files changed, 332 insertions, 88 deletions
diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c
index f0907c46b0..3f24e27a1c 100644
--- a/src/core/devices/wwan/nm-modem-broadband.c
+++ b/src/core/devices/wwan/nm-modem-broadband.c
@@ -44,6 +44,7 @@ typedef enum {
CONNECT_STEP_WAIT_FOR_SIM,
CONNECT_STEP_UNLOCK,
CONNECT_STEP_WAIT_FOR_READY,
+ CONNECT_STEP_INTIAL_EPS_BEARER,
CONNECT_STEP_CONNECT,
CONNECT_STEP_LAST,
} ConnectStep;
@@ -561,6 +562,34 @@ out:
}
static void
+set_initial_eps_bearer_settings_ready(MMModem3gpp *modem_3gpp_iface,
+ GAsyncResult *res,
+ NMModemBroadband *self)
+{
+ gs_free_error GError *error = NULL;
+
+ if (!mm_modem_3gpp_set_initial_eps_bearer_settings_finish(modem_3gpp_iface, res, &error)) {
+ if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
+ if (!g_error_matches(error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) {
+ _LOGW("failed to set initial EPS bearer settings: %s", error->message);
+ nm_modem_emit_prepare_result(NM_MODEM(self),
+ FALSE,
+ NM_DEVICE_STATE_REASON_GSM_APN_FAILED);
+ connect_context_clear(self);
+ return;
+ }
+
+ _LOGD("failed to set initial EPS bearer settings due to lack of support: %s",
+ error->message);
+ }
+
+ self->_priv.ctx->step++;
+ connect_context_step(self);
+}
+
+static void
connect_context_step(NMModemBroadband *self)
{
ConnectContext *ctx = self->_priv.ctx;
@@ -629,6 +658,52 @@ connect_context_step(NMModemBroadband *self)
ctx->step++;
}
/* fall-through */
+
+ case CONNECT_STEP_INTIAL_EPS_BEARER:
+ if (MODEM_CAPS_3GPP(ctx->caps)) {
+ NMSettingGsm *s_gsm = nm_connection_get_setting_gsm(ctx->connection);
+ const char *apn = nm_setting_gsm_get_initial_eps_apn(s_gsm);
+ gboolean do_config = nm_setting_gsm_get_initial_eps_config(s_gsm);
+
+ /* assume do_config is true if an APN is set */
+ if (apn || do_config) {
+ gs_unref_object MMBearerProperties *config = NULL;
+ NMModemIPType ip_type = nm_modem_get_initial_eps_bearer_ip_type(ctx->ip_types);
+
+ config = mm_bearer_properties_new();
+ switch (ip_type) {
+ case NM_MODEM_IP_TYPE_IPV4:
+ mm_bearer_properties_set_ip_type(config, MM_BEARER_IP_FAMILY_IPV4);
+ break;
+ case NM_MODEM_IP_TYPE_IPV6:
+ mm_bearer_properties_set_ip_type(config, MM_BEARER_IP_FAMILY_IPV6);
+ break;
+ case NM_MODEM_IP_TYPE_IPV4V6:
+ mm_bearer_properties_set_ip_type(config, MM_BEARER_IP_FAMILY_IPV4V6);
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ if (apn)
+ mm_bearer_properties_set_apn(config, apn);
+
+ /*
+ * Setting the initial EPS bearer settings is a no-op in
+ * ModemManager if the desired configuration is already active.
+ */
+ mm_modem_3gpp_set_initial_eps_bearer_settings(
+ self->_priv.modem_3gpp_iface,
+ config,
+ ctx->cancellable,
+ (GAsyncReadyCallback) set_initial_eps_bearer_settings_ready,
+ self);
+ break;
+ }
+ }
+ ctx->step++;
+ /* fall-through */
+
case CONNECT_STEP_CONNECT:
if (!ctx->connect_properties)
break;
diff --git a/src/core/devices/wwan/nm-modem.c b/src/core/devices/wwan/nm-modem.c
index 0159d35109..ea0fa7aac5 100644
--- a/src/core/devices/wwan/nm-modem.c
+++ b/src/core/devices/wwan/nm-modem.c
@@ -558,6 +558,37 @@ nm_modem_get_connection_ip_type(NMModem *self, NMConnection *connection, GError
return NULL;
}
+/**
+ * nm_modem_get_initial_eps_bearer_ip_type:
+ * @connection_ip_types: the #NMModemIPType as returned by
+ * nm_modem_get_connection_ip_type
+ *
+ * Given the connection IP types, this function returns which IP type to use when
+ * configuring the initial EPS bearer.
+ *
+ * Returns: the #NMModemIpType value to use for the initial EPS bearer
+ */
+NMModemIPType
+nm_modem_get_initial_eps_bearer_ip_type(const GArray *connection_ip_types)
+{
+ NMModemIPType ip_types = NM_MODEM_IP_TYPE_UNKNOWN;
+ guint i;
+
+ nm_assert(connection_ip_types);
+
+ for (i = 0; i < connection_ip_types->len; i++)
+ ip_types |= nm_g_array_index(connection_ip_types, NMModemIPType, i);
+
+ nm_assert(ip_types != NM_MODEM_IP_TYPE_UNKNOWN);
+
+ if (ip_types & NM_MODEM_IP_TYPE_IPV4V6)
+ return NM_MODEM_IP_TYPE_IPV4V6;
+ if (ip_types & NM_MODEM_IP_TYPE_IPV4)
+ return NM_MODEM_IP_TYPE_IPV4;
+
+ return NM_MODEM_IP_TYPE_IPV6;
+}
+
const char *
nm_modem_get_device_id(NMModem *self)
{
diff --git a/src/core/devices/wwan/nm-modem.h b/src/core/devices/wwan/nm-modem.h
index ec00110280..021d77b2ad 100644
--- a/src/core/devices/wwan/nm-modem.h
+++ b/src/core/devices/wwan/nm-modem.h
@@ -226,6 +226,8 @@ void nm_modem_emit_ppp_failed(NMModem *self, NMDeviceStateReason reason);
GArray *nm_modem_get_connection_ip_type(NMModem *self, NMConnection *connection, GError **error);
+NMModemIPType nm_modem_get_initial_eps_bearer_ip_type(const GArray *connection_ip_types);
+
/* For subclasses */
void nm_modem_emit_signal_new_config(NMModem *self,
diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver
index 732c933e57..75726d7caa 100644
--- a/src/libnm-client-impl/libnm.ver
+++ b/src/libnm-client-impl/libnm.ver
@@ -1923,4 +1923,6 @@ global:
libnm_1_44_0 {
global:
nm_active_connection_get_controller;
+ nm_setting_gsm_get_initial_eps_apn;
+ nm_setting_gsm_get_initial_eps_config;
} libnm_1_42_0;
diff --git a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in
index 3b210b1686..562ba7916f 100644
--- a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in
+++ b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in
@@ -1313,6 +1313,14 @@
dbus-type="b"
gprop-type="gboolean"
/>
+ <property name="initial-eps-bearer-apn"
+ dbus-type="s"
+ gprop-type="gchararray"
+ />
+ <property name="initial-eps-bearer-configure"
+ dbus-type="b"
+ gprop-type="gboolean"
+ />
<property name="mtu"
dbus-type="u"
gprop-type="guint"
diff --git a/src/libnm-core-impl/nm-setting-gsm.c b/src/libnm-core-impl/nm-setting-gsm.c
index 3fe5dfa11a..c68cdf3b72 100644
--- a/src/libnm-core-impl/nm-setting-gsm.c
+++ b/src/libnm-core-impl/nm-setting-gsm.c
@@ -36,7 +36,9 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_AUTO_CONFIG,
PROP_DEVICE_ID,
PROP_SIM_ID,
PROP_SIM_OPERATOR_ID,
- PROP_MTU, );
+ PROP_MTU,
+ PROP_INITIAL_EPS_CONFIG,
+ PROP_INITIAL_EPS_APN, );
typedef struct {
char *number;
@@ -48,11 +50,13 @@ typedef struct {
char *apn;
char *network_id;
char *pin;
+ char *initial_eps_apn;
guint password_flags;
guint pin_flags;
guint32 mtu;
bool auto_config;
bool home_only;
+ bool initial_eps_config;
} NMSettingGsmPrivate;
/**
@@ -286,6 +290,103 @@ nm_setting_gsm_get_mtu(NMSettingGsm *setting)
return NM_SETTING_GSM_GET_PRIVATE(setting)->mtu;
}
+/**
+ * nm_setting_gsm_get_initial_eps_config:
+ * @setting: the #NMSettingGsm
+ *
+ * Returns: the #NMSettingGsm:initial-eps-bearer-configure property of the setting
+ *
+ * Since: 1.44
+ **/
+gboolean
+nm_setting_gsm_get_initial_eps_config(NMSettingGsm *setting)
+{
+ g_return_val_if_fail(NM_IS_SETTING_GSM(setting), FALSE);
+
+ return NM_SETTING_GSM_GET_PRIVATE(setting)->initial_eps_config;
+}
+
+/**
+ * nm_setting_gsm_get_initial_eps_apn:
+ * @setting: the #NMSettingGsm
+ *
+ * Returns: the #NMSettingGsm:initial-eps-bearer-apn property of the setting
+ *
+ * Since: 1.44
+ **/
+const char *
+nm_setting_gsm_get_initial_eps_apn(NMSettingGsm *setting)
+{
+ g_return_val_if_fail(NM_IS_SETTING_GSM(setting), NULL);
+
+ return NM_SETTING_GSM_GET_PRIVATE(setting)->initial_eps_apn;
+}
+
+static gboolean
+_verify_apn(const char *apn, gboolean allow_empty, const char *property_name, GError **error)
+{
+ gsize apn_len;
+ gsize i;
+
+ if (!apn)
+ return TRUE;
+
+ apn_len = strlen(apn);
+
+ if (!allow_empty && apn_len == 0) {
+ g_set_error(error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("property value is empty"));
+ g_prefix_error(error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, property_name);
+ return FALSE;
+ }
+
+ if (apn_len > 64) {
+ g_set_error(error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("property value is too long (>64)"));
+ g_prefix_error(error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, property_name);
+ return FALSE;
+ }
+
+ /* APNs roughly follow the same rules as DNS domain names. Allowed
+ * characters are a-z, 0-9, . and -. GSM 03.03 Section 9.1 states:
+ *
+ * The syntax of the APN shall follow the Name Syntax defined in
+ * RFC 2181 [14] and RFC 1035 [15]. The APN consists of one or
+ * more labels. Each label is coded as one octet length field
+ * followed by that number of octets coded as 8 bit ASCII characters.
+ * Following RFC 1035 [15] the labels should consist only of the
+ * alphabetic characters (A-Z and a-z), digits (0-9) and the
+ * dash (-). The case of alphabetic characters is not significant.
+ *
+ * A dot (.) is commonly used to separate parts of the APN, and
+ * apparently the underscore (_) is used as well. RFC 2181 indicates
+ * that no restrictions of any kind are placed on DNS labels, and thus
+ * it would appear that none are placed on APNs either, but many modems
+ * and networks will fail to accept APNs that include odd characters
+ * like space ( ) and such.
+ */
+ for (i = 0; i < apn_len; i++) {
+ if (g_ascii_isalnum(apn[i]))
+ continue;
+ if (NM_IN_SET(apn[i], '.', '_', '-'))
+ continue;
+
+ g_set_error(error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("'%s' contains invalid char(s) (use [A-Za-z._-])"),
+ apn);
+ g_prefix_error(error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, property_name);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static gboolean
verify(NMSetting *setting, NMConnection *connection, GError **error)
{
@@ -300,51 +401,11 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->apn) {
- gsize apn_len = strlen(priv->apn);
- gsize i;
-
- if (apn_len > 64) {
- g_set_error(error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property value '%s' is empty or too long (>64)"),
- priv->apn);
- g_prefix_error(error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_APN);
- return FALSE;
- }
+ if (!_verify_apn(priv->apn, TRUE, NM_SETTING_GSM_APN, error))
+ return FALSE;
- /* APNs roughly follow the same rules as DNS domain names. Allowed
- * characters are a-z, 0-9, . and -. GSM 03.03 Section 9.1 states:
- *
- * The syntax of the APN shall follow the Name Syntax defined in
- * RFC 2181 [14] and RFC 1035 [15]. The APN consists of one or
- * more labels. Each label is coded as one octet length field
- * followed by that number of octets coded as 8 bit ASCII characters.
- * Following RFC 1035 [15] the labels should consist only of the
- * alphabetic characters (A-Z and a-z), digits (0-9) and the
- * dash (-). The case of alphabetic characters is not significant.
- *
- * A dot (.) is commonly used to separate parts of the APN, and
- * apparently the underscore (_) is used as well. RFC 2181 indicates
- * that no restrictions of any kind are placed on DNS labels, and thus
- * it would appear that none are placed on APNs either, but many modems
- * and networks will fail to accept APNs that include odd characters
- * like space ( ) and such.
- */
- for (i = 0; i < apn_len; i++) {
- if (!g_ascii_isalnum(priv->apn[i]) && (priv->apn[i] != '.') && (priv->apn[i] != '_')
- && (priv->apn[i] != '-')) {
- g_set_error(error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("'%s' contains invalid char(s) (use [A-Za-z._-])"),
- priv->apn);
- g_prefix_error(error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_APN);
- return FALSE;
- }
- }
- }
+ if (!_verify_apn(priv->initial_eps_apn, FALSE, NM_SETTING_GSM_INITIAL_EPS_BEARER_APN, error))
+ return FALSE;
if (priv->username && priv->username[0] == '\0') {
g_set_error_literal(error,
@@ -742,6 +803,41 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
NMSettingGsmPrivate,
mtu);
+ /**
+ * NMSettingGsm:initial-eps-bearer-configure:
+ *
+ * For LTE modems, this setting determines whether the initial EPS bearer
+ * shall be configured when bringing up the connection. It is inferred TRUE
+ * if initial-eps-bearer-apn is set.
+ *
+ * Since: 1.44
+ **/
+ _nm_setting_property_define_direct_boolean(properties_override,
+ obj_properties,
+ NM_SETTING_GSM_INITIAL_EPS_BEARER_CONFIGURE,
+ PROP_INITIAL_EPS_CONFIG,
+ FALSE,
+ NM_SETTING_PARAM_NONE,
+ NMSettingGsmPrivate,
+ initial_eps_config);
+
+ /**
+ * NMSettingGsm:initial-eps-bearer-apn:
+ *
+ * For LTE modems, this sets the APN for the initial EPS bearer that is set
+ * up when attaching to the network. Setting this parameters implies
+ * initial-eps-bearer-configure to be TRUE.
+ *
+ * Since: 1.44
+ **/
+ _nm_setting_property_define_direct_string(properties_override,
+ obj_properties,
+ NM_SETTING_GSM_INITIAL_EPS_BEARER_APN,
+ PROP_INITIAL_EPS_APN,
+ NM_SETTING_PARAM_NONE,
+ NMSettingGsmPrivate,
+ initial_eps_apn);
+
/* Ignore incoming deprecated properties */
_nm_properties_override_dbus(properties_override,
"allowed-bands",
diff --git a/src/libnm-core-public/nm-setting-gsm.h b/src/libnm-core-public/nm-setting-gsm.h
index 0d57511d9f..dd5b0b26de 100644
--- a/src/libnm-core-public/nm-setting-gsm.h
+++ b/src/libnm-core-public/nm-setting-gsm.h
@@ -26,19 +26,21 @@ G_BEGIN_DECLS
#define NM_SETTING_GSM_SETTING_NAME "gsm"
-#define NM_SETTING_GSM_AUTO_CONFIG "auto-config"
-#define NM_SETTING_GSM_USERNAME "username"
-#define NM_SETTING_GSM_PASSWORD "password"
-#define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags"
-#define NM_SETTING_GSM_APN "apn"
-#define NM_SETTING_GSM_NETWORK_ID "network-id"
-#define NM_SETTING_GSM_PIN "pin"
-#define NM_SETTING_GSM_PIN_FLAGS "pin-flags"
-#define NM_SETTING_GSM_HOME_ONLY "home-only"
-#define NM_SETTING_GSM_DEVICE_ID "device-id"
-#define NM_SETTING_GSM_SIM_ID "sim-id"
-#define NM_SETTING_GSM_SIM_OPERATOR_ID "sim-operator-id"
-#define NM_SETTING_GSM_MTU "mtu"
+#define NM_SETTING_GSM_AUTO_CONFIG "auto-config"
+#define NM_SETTING_GSM_USERNAME "username"
+#define NM_SETTING_GSM_PASSWORD "password"
+#define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags"
+#define NM_SETTING_GSM_APN "apn"
+#define NM_SETTING_GSM_NETWORK_ID "network-id"
+#define NM_SETTING_GSM_PIN "pin"
+#define NM_SETTING_GSM_PIN_FLAGS "pin-flags"
+#define NM_SETTING_GSM_HOME_ONLY "home-only"
+#define NM_SETTING_GSM_DEVICE_ID "device-id"
+#define NM_SETTING_GSM_SIM_ID "sim-id"
+#define NM_SETTING_GSM_SIM_OPERATOR_ID "sim-operator-id"
+#define NM_SETTING_GSM_MTU "mtu"
+#define NM_SETTING_GSM_INITIAL_EPS_BEARER_CONFIGURE "initial-eps-bearer-configure"
+#define NM_SETTING_GSM_INITIAL_EPS_BEARER_APN "initial-eps-bearer-apn"
/* Deprecated */
#define NM_SETTING_GSM_NUMBER "number"
@@ -67,6 +69,10 @@ NM_AVAILABLE_IN_1_2
const char *nm_setting_gsm_get_sim_operator_id(NMSettingGsm *setting);
NM_AVAILABLE_IN_1_8
guint32 nm_setting_gsm_get_mtu(NMSettingGsm *setting);
+NM_AVAILABLE_IN_1_44
+gboolean nm_setting_gsm_get_initial_eps_config(NMSettingGsm *setting);
+NM_AVAILABLE_IN_1_44
+const char *nm_setting_gsm_get_initial_eps_apn(NMSettingGsm *setting);
NM_DEPRECATED_IN_1_16
const char *nm_setting_gsm_get_number(NMSettingGsm *setting);
diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c
index f3372fb230..d0714a86ab 100644
--- a/src/libnmc-setting/nm-meta-setting-desc.c
+++ b/src/libnmc-setting/nm-meta-setting-desc.c
@@ -5971,6 +5971,12 @@ static const NMMetaPropertyInfo *const property_infos_GSM[] = {
.get_fcn = MTU_GET_FCN (NMSettingGsm, nm_setting_gsm_get_mtu),
),
),
+ PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_INITIAL_EPS_BEARER_CONFIGURE,
+ .property_type = &_pt_gobject_bool,
+ ),
+ PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_INITIAL_EPS_BEARER_APN,
+ .property_type = &_pt_gobject_string,
+ ),
NULL
};
diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in
index b7f1dc2458..0f68b5d118 100644
--- a/src/libnmc-setting/settings-docs.h.in
+++ b/src/libnmc-setting/settings-docs.h.in
@@ -141,6 +141,8 @@
#define DESCRIBE_DOC_NM_SETTING_GSM_AUTO_CONFIG N_("When TRUE, the settings such as APN, username, or password will default to values that match the network the modem will register to in the Mobile Broadband Provider database.")
#define DESCRIBE_DOC_NM_SETTING_GSM_DEVICE_ID N_("The device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device.")
#define DESCRIBE_DOC_NM_SETTING_GSM_HOME_ONLY N_("When TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.")
+#define DESCRIBE_DOC_NM_SETTING_GSM_INITIAL_EPS_BEARER_APN N_("For LTE modems, this sets the APN for the initial EPS bearer that is set up when attaching to the network. Setting this parameters implies initial-eps-bearer-configure to be TRUE.")
+#define DESCRIBE_DOC_NM_SETTING_GSM_INITIAL_EPS_BEARER_CONFIGURE N_("For LTE modems, this setting determines whether the initial EPS bearer shall be configured when bringing up the connection. It is inferred TRUE if initial-eps-bearer-apn is set.")
#define DESCRIBE_DOC_NM_SETTING_GSM_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames.")
#define DESCRIBE_DOC_NM_SETTING_GSM_NETWORK_ID N_("The Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration. If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible.")
#define DESCRIBE_DOC_NM_SETTING_GSM_NUMBER N_("Legacy setting that used to help establishing PPP data sessions for GSM-based modems.")
diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
index cec7a58eb8..0a7ab2d8ac 100644
--- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
+++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
@@ -588,6 +588,10 @@
description="A MCC/MNC string like &quot;310260&quot; or &quot;21601&quot; identifying the specific mobile network operator which this connection applies to. If given, the connection will apply to any device also allowed by &quot;device-id&quot; and &quot;sim-id&quot; which contains a SIM card provisioned by the given operator." />
<property name="mtu"
description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames." />
+ <property name="initial-eps-bearer-configure"
+ description="For LTE modems, this setting determines whether the initial EPS bearer shall be configured when bringing up the connection. It is inferred TRUE if initial-eps-bearer-apn is set." />
+ <property name="initial-eps-bearer-apn"
+ description="For LTE modems, this sets the APN for the initial EPS bearer that is set up when attaching to the network. Setting this parameters implies initial-eps-bearer-configure to be TRUE." />
</setting>
<setting name="hostname" >
<property name="priority"
diff --git a/src/tests/client/test-client.check-on-disk/test_003.expected b/src/tests/client/test-client.check-on-disk/test_003.expected
index a48c23c1ab..ae4ad72dc1 100644
--- a/src/tests/client/test-client.check-on-disk/test_003.expected
+++ b/src/tests/client/test-client.check-on-disk/test_003.expected
@@ -182,12 +182,12 @@ id
path
uuid
<<<
-size: 4990
+size: 5076
location: src/tests/client/test-client.py:test_003()/14
cmd: $NMCLI con s con-gsm1
lang: C
returncode: 0
-stdout: 4857 bytes
+stdout: 4943 bytes
>>>
connection.id: con-gsm1
connection.uuid: UUID-con-gsm1-REPLACED-REPLACED-REPL
@@ -291,18 +291,20 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: auto
+gsm.initial-eps-bearer-configure: no
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 5028
+size: 5115
location: src/tests/client/test-client.py:test_003()/15
cmd: $NMCLI con s con-gsm1
lang: pl_PL.UTF-8
returncode: 0
-stdout: 4885 bytes
+stdout: 4972 bytes
>>>
connection.id: con-gsm1
connection.uuid: UUID-con-gsm1-REPLACED-REPLACED-REPL
@@ -406,48 +408,50 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: automatyczne
+gsm.initial-eps-bearer-configure: nie
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: nie
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 499
+size: 503
location: src/tests/client/test-client.py:test_003()/16
cmd: $NMCLI -g all con s con-gsm1
lang: C
returncode: 0
-stdout: 360 bytes
+stdout: 364 bytes
>>>
connection:con-gsm1:UUID-con-gsm1-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<
-size: 509
+size: 513
location: src/tests/client/test-client.py:test_003()/17
cmd: $NMCLI -g all con s con-gsm1
lang: pl_PL.UTF-8
returncode: 0
-stdout: 360 bytes
+stdout: 364 bytes
>>>
connection:con-gsm1:UUID-con-gsm1-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<
-size: 4978
+size: 5064
location: src/tests/client/test-client.py:test_003()/18
cmd: $NMCLI con s con-gsm2
lang: C
returncode: 0
-stdout: 4845 bytes
+stdout: 4931 bytes
>>>
connection.id: con-gsm2
connection.uuid: UUID-con-gsm2-REPLACED-REPLACED-REPL
@@ -551,18 +555,20 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: auto
+gsm.initial-eps-bearer-configure: no
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 5016
+size: 5103
location: src/tests/client/test-client.py:test_003()/19
cmd: $NMCLI con s con-gsm2
lang: pl_PL.UTF-8
returncode: 0
-stdout: 4873 bytes
+stdout: 4960 bytes
>>>
connection.id: con-gsm2
connection.uuid: UUID-con-gsm2-REPLACED-REPLACED-REPL
@@ -666,48 +672,50 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: automatyczne
+gsm.initial-eps-bearer-configure: nie
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: nie
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 487
+size: 491
location: src/tests/client/test-client.py:test_003()/20
cmd: $NMCLI -g all con s con-gsm2
lang: C
returncode: 0
-stdout: 348 bytes
+stdout: 352 bytes
>>>
connection:con-gsm2:UUID-con-gsm2-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0:::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0:::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<
-size: 497
+size: 501
location: src/tests/client/test-client.py:test_003()/21
cmd: $NMCLI -g all con s con-gsm2
lang: pl_PL.UTF-8
returncode: 0
-stdout: 348 bytes
+stdout: 352 bytes
>>>
connection:con-gsm2:UUID-con-gsm2-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0:::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0:::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<
-size: 4978
+size: 5064
location: src/tests/client/test-client.py:test_003()/22
cmd: $NMCLI con s con-gsm3
lang: C
returncode: 0
-stdout: 4845 bytes
+stdout: 4931 bytes
>>>
connection.id: con-gsm3
connection.uuid: UUID-con-gsm3-REPLACED-REPLACED-REPL
@@ -811,18 +819,20 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: auto
+gsm.initial-eps-bearer-configure: no
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 5016
+size: 5103
location: src/tests/client/test-client.py:test_003()/23
cmd: $NMCLI con s con-gsm3
lang: pl_PL.UTF-8
returncode: 0
-stdout: 4873 bytes
+stdout: 4960 bytes
>>>
connection.id: con-gsm3
connection.uuid: UUID-con-gsm3-REPLACED-REPLACED-REPL
@@ -926,39 +936,41 @@ gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: automatyczne
+gsm.initial-eps-bearer-configure: nie
+gsm.initial-eps-bearer-apn: --
proxy.method: none
proxy.browser-only: nie
proxy.pac-url: --
proxy.pac-script: --
<<<
-size: 488
+size: 492
location: src/tests/client/test-client.py:test_003()/24
cmd: $NMCLI -g all con s con-gsm3
lang: C
returncode: 0
-stdout: 349 bytes
+stdout: 353 bytes
>>>
connection:con-gsm3:UUID-con-gsm3-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<
-size: 498
+size: 502
location: src/tests/client/test-client.py:test_003()/25
cmd: $NMCLI -g all con s con-gsm3
lang: pl_PL.UTF-8
returncode: 0
-stdout: 349 bytes
+stdout: 353 bytes
>>>
connection:con-gsm3:UUID-con-gsm3-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1:-1:0x0:-1:-1
ipv4:auto::: :0::::-1:0::no:no:::0:yes:::0x0:no:yes:-1:-1::0::-1
ipv6:auto::::0::::-1:0::no:no:no:yes:-1:-1:default:0:auto:::0:yes::0x0:-1:
serial:5:8:even:1:100
-gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto
+gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto:no:
proxy:none:no::
<<<