mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 08:18:03 +02:00
libnm-util: add nm_setting_gsm_get_home_only()
For roaming control.
This commit is contained in:
parent
4af1cc2661
commit
d924003320
4 changed files with 42 additions and 4 deletions
|
|
@ -59,7 +59,7 @@ libnm_util_la_SOURCES= \
|
||||||
libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
|
libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
|
||||||
|
|
||||||
libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \
|
libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \
|
||||||
-version-info "3:0:2"
|
-version-info "4:0:3"
|
||||||
|
|
||||||
if WITH_GNUTLS
|
if WITH_GNUTLS
|
||||||
libnm_util_la_SOURCES += crypto_gnutls.c
|
libnm_util_la_SOURCES += crypto_gnutls.c
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ global:
|
||||||
nm_setting_gsm_get_band;
|
nm_setting_gsm_get_band;
|
||||||
nm_setting_gsm_get_pin;
|
nm_setting_gsm_get_pin;
|
||||||
nm_setting_gsm_get_puk;
|
nm_setting_gsm_get_puk;
|
||||||
|
nm_setting_gsm_get_home_only;
|
||||||
nm_setting_ip4_config_error_get_type;
|
nm_setting_ip4_config_error_get_type;
|
||||||
nm_setting_ip4_config_error_quark;
|
nm_setting_ip4_config_error_quark;
|
||||||
nm_setting_ip4_config_get_type;
|
nm_setting_ip4_config_get_type;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301 USA.
|
* Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* (C) Copyright 2007 - 2008 Red Hat, Inc.
|
* (C) Copyright 2007 - 2010 Red Hat, Inc.
|
||||||
* (C) Copyright 2007 - 2008 Novell, Inc.
|
* (C) Copyright 2007 - 2008 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -80,6 +80,8 @@ typedef struct {
|
||||||
guint32 allowed_bands; /* A bitfield of NM_SETTING_GSM_BAND_* */
|
guint32 allowed_bands; /* A bitfield of NM_SETTING_GSM_BAND_* */
|
||||||
|
|
||||||
char *pin;
|
char *pin;
|
||||||
|
|
||||||
|
gboolean home_only;
|
||||||
} NMSettingGsmPrivate;
|
} NMSettingGsmPrivate;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -94,6 +96,7 @@ enum {
|
||||||
PROP_PIN,
|
PROP_PIN,
|
||||||
PROP_PUK,
|
PROP_PUK,
|
||||||
PROP_ALLOWED_BANDS,
|
PROP_ALLOWED_BANDS,
|
||||||
|
PROP_HOME_ONLY,
|
||||||
|
|
||||||
LAST_PROP
|
LAST_PROP
|
||||||
};
|
};
|
||||||
|
|
@ -191,6 +194,14 @@ nm_setting_gsm_get_puk (NMSettingGsm *setting)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_setting_gsm_get_home_only (NMSettingGsm *setting)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE);
|
||||||
|
|
||||||
|
return NM_SETTING_GSM_GET_PRIVATE (setting)->home_only;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
verify (NMSetting *setting, GSList *all_settings, GError **error)
|
verify (NMSetting *setting, GSList *all_settings, GError **error)
|
||||||
{
|
{
|
||||||
|
|
@ -356,6 +367,9 @@ set_property (GObject *object, guint prop_id,
|
||||||
if (str && strlen (str))
|
if (str && strlen (str))
|
||||||
g_warning ("Tried to set deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_PUK);
|
g_warning ("Tried to set deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_PUK);
|
||||||
break;
|
break;
|
||||||
|
case PROP_HOME_ONLY:
|
||||||
|
priv->home_only = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -401,6 +415,9 @@ get_property (GObject *object, guint prop_id,
|
||||||
/* deprecated */
|
/* deprecated */
|
||||||
g_value_set_int (value, -1);
|
g_value_set_int (value, -1);
|
||||||
break;
|
break;
|
||||||
|
case PROP_HOME_ONLY:
|
||||||
|
g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -572,7 +589,8 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class)
|
||||||
|| NM_SETTING_GSM_BAND_U800
|
|| NM_SETTING_GSM_BAND_U800
|
||||||
|| NM_SETTING_GSM_BAND_U850
|
|| NM_SETTING_GSM_BAND_U850
|
||||||
|| NM_SETTING_GSM_BAND_U900
|
|| NM_SETTING_GSM_BAND_U900
|
||||||
|| NM_SETTING_GSM_BAND_U17IX,
|
|| NM_SETTING_GSM_BAND_U17IX
|
||||||
|
|| NM_SETTING_GSM_BAND_U1900,
|
||||||
NM_SETTING_GSM_BAND_ANY,
|
NM_SETTING_GSM_BAND_ANY,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
||||||
|
|
||||||
|
|
@ -593,6 +611,22 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class)
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));
|
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMSettingGsm:home-only:
|
||||||
|
*
|
||||||
|
* When TRUE, only connections to the home network will be allowed.
|
||||||
|
* Connections to roaming networks will not be made.
|
||||||
|
**/
|
||||||
|
g_object_class_install_property
|
||||||
|
(object_class, PROP_HOME_ONLY,
|
||||||
|
g_param_spec_boolean (NM_SETTING_GSM_HOME_ONLY,
|
||||||
|
"PIN",
|
||||||
|
"When TRUE, only connections to the home network will "
|
||||||
|
"be allowed. Connections to roaming networks will "
|
||||||
|
"not be made.",
|
||||||
|
FALSE,
|
||||||
|
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
|
||||||
|
|
||||||
/* Deprecated properties */
|
/* Deprecated properties */
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:puk:
|
* NMSettingGsm:puk:
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301 USA.
|
* Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* (C) Copyright 2007 - 2008 Red Hat, Inc.
|
* (C) Copyright 2007 - 2010 Red Hat, Inc.
|
||||||
* (C) Copyright 2007 - 2008 Novell, Inc.
|
* (C) Copyright 2007 - 2008 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -61,6 +61,7 @@ GQuark nm_setting_gsm_error_quark (void);
|
||||||
#define NM_SETTING_GSM_NETWORK_TYPE "network-type"
|
#define NM_SETTING_GSM_NETWORK_TYPE "network-type"
|
||||||
#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands"
|
#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands"
|
||||||
#define NM_SETTING_GSM_PIN "pin"
|
#define NM_SETTING_GSM_PIN "pin"
|
||||||
|
#define NM_SETTING_GSM_HOME_ONLY "home-only"
|
||||||
|
|
||||||
/* DEPRECATED & UNUSED */
|
/* DEPRECATED & UNUSED */
|
||||||
#define NM_SETTING_GSM_PUK "puk"
|
#define NM_SETTING_GSM_PUK "puk"
|
||||||
|
|
@ -95,6 +96,7 @@ typedef enum {
|
||||||
NM_SETTING_GSM_BAND_U850 = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz (Class V) */
|
NM_SETTING_GSM_BAND_U850 = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz (Class V) */
|
||||||
NM_SETTING_GSM_BAND_U900 = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz (Class VIII) */
|
NM_SETTING_GSM_BAND_U900 = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz (Class VIII) */
|
||||||
NM_SETTING_GSM_BAND_U17IX = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz (Class IX) */
|
NM_SETTING_GSM_BAND_U17IX = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz (Class IX) */
|
||||||
|
NM_SETTING_GSM_BAND_U1900 = 0x00001000, /* WCDMA 3GPP UMTS 1900 MHz (Class II) */
|
||||||
} NMSettingGsmNetworkBand;
|
} NMSettingGsmNetworkBand;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -122,6 +124,7 @@ const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting);
|
||||||
int nm_setting_gsm_get_network_type (NMSettingGsm *setting);
|
int nm_setting_gsm_get_network_type (NMSettingGsm *setting);
|
||||||
guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting);
|
guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting);
|
||||||
const char *nm_setting_gsm_get_pin (NMSettingGsm *setting);
|
const char *nm_setting_gsm_get_pin (NMSettingGsm *setting);
|
||||||
|
gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting);
|
||||||
|
|
||||||
/* DEPRECATED & UNUSED */
|
/* DEPRECATED & UNUSED */
|
||||||
const char *nm_setting_gsm_get_puk (NMSettingGsm *setting);
|
const char *nm_setting_gsm_get_puk (NMSettingGsm *setting);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue