summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting-gsm.c
Commit message (Collapse)AuthorAgeFilesLines
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* all: drop includes to <glib/gi18n.h> for "nm-default.h"Dan Winship2015-08-051-1/+0
| | | | | | | The localization headers are now included via "nm-default.h". Also fixes several places, where we wrongly included <glib/gi18n-lib.h> instead of <glib/gi18n.h>. For example under "clients/" directory.
* libnm: don't check for valid passwords in NMSetting:verify()Thomas Haller2015-03-201-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | We must never fail verification of a connection based on a password because the password is re-requested during activation. Otherwise, if the user enters an invalid password for a (previously) valid connection, the connection becomes invalid. NetworkManager does not expect or handle that requesting password can make a connection invalid. Invalid passwords should be treated as wrong passwords. Only a UI (such as nm-connection-editor or nmcli) should validate passwords against a certain scheme. Note that there is need_secrets() which on the contrary must check for valid passwords. Error scenario: Connect to a WEP Wi-Fi, via `nmcli device wifi connect SSID`. The generated connection has wep-key-type=0 (UNKNOWN) and wep-key-flags=0. When trying to connect, NM will ask for secrets and set the wep-key0 field. After that, verification can fail (e.g. if the password is longer then 64 chars).
* libnm: fix error prefix in NMSettingGsm:verify()Thomas Haller2015-03-171-1/+1
|
* libnm*: fix library gettext usageDan Winship2014-11-131-1/+1
| | | | | | | | | | | | | | | | | Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _() will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than "gettext (string)" (which will use the program's default domain, which works fine for programs in the NetworkManager tree, but not for external users). Likewise, we need to call bindtextdomain() so that gettext can find the translations if the library is installed in a different prefix from the program using it (and bind_textdomain_codeset(), so it will know the translations are in UTF-8 even if the locale isn't). (The fact that no one noticed this was broken before is because the libraries didn't really start returning useful translated strings much until 0.9.10, and none of the out-of-tree clients have been updated to actually show those strings to users yet.)
* all: consistently include config.hDan Winship2014-11-131-0/+2
| | | | | | | | | | | config.h should be included from every .c file, and it should be included before any other include. Fix that. (As a side effect of how I did this, this also changes us to consistently use "config.h" rather than <config.h>. To the extent that it matters [which is not much], quotes are more correct anyway, since we're talking about a file in our own build tree, not a system include.)
* libnm-util, libnm-glib: whitespace fixesDan Winship2014-07-151-6/+10
| | | | Fix indentation, kill trailing whitespace, split some long lines.
* libnm-util, libnm-glib: standardize copyright/license headersDan Winship2014-07-151-5/+2
| | | | | | | | | | | | | | | | | | - Remove list of authors from files that had them; these serve no purpose except to quickly get out of date (and were only used in libnm-util and not libnm-glib anyway). - Just say "Copyright", not "(C) Copyright" or "Copyright (C)" - Put copyright statement after the license, not before - Remove "NetworkManager - Network link manager" from the few files that contained it, and "libnm_glib -- Access network status & information from glib applications" from the many files that contained it. - Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline to files that were missing it.
* libnm-util: remove NMSetting* GParamSpec docsDan Winship2014-06-191-89/+44
| | | | | | | | | | | | Remove all the GParamSpec docs, since everything now uses the gtk-doc docs instead, so there's no point in having two copies of each (which are often out of sync anyway). Since we're touching so many lines anyway, also fix up the indentation of the remaining property-installing lines, and add G_PARAM_STATIC_STRINGS to each paramspec (so the nick strings don't get strduped). Also, be consistent about starting a new line between "g_object_class_install_property" and its opening parenthesis.
* libnm-util: various NMSetting* property doc fixes/improvementsDan Winship2014-06-191-10/+17
| | | | | | | | | | Fix up various issues with the docs for the NMSetting properties, and pull in text from the GParamSpec docs where the GParamSpec docs were better (or contained information that is necessary in the context of nm-settings.5). Also, consistently wrap all of the doc comments to the same width (80 columns).
* libnm-util: fix gtk-doc bugs in NMSetting* propertiesDan Winship2014-06-191-1/+1
| | | | | | | | Fix misused gtk-doc annotations and incorrectly-identified properties. In particular, the upcoming introspection-based generate-settings-spec expands macro and enum values, so if you use '%' where you should have used '#', it will fail to find an expansion, and error out.
* libnm-util: refactor NMSetting name and register_settingsThomas Haller2013-12-121-1/+0
| | | | | | | | | | | | | | | | - refactor register_settings to allow lookup by GType and add the settings name to SettingInfo. - setting NM_SETTING_NAME is deprecated and should not be set anymore. Indeed it has always be a bug, to reset the name to a different value. The only valid place to set the name was in the _init() function of the derived class itself. This is now no longer needed/possible. Instead the name get's detected based on the registered setting types. This makes use of the registered metadata that is available anyway since every usable setting has to register itself. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: remove usage of NM_SETTING_PARAM_SERIALIZEDan Williams2013-12-021-11/+11
| | | | | The only property that is not serializes is each settings' 'name' property, so the flag serves no purpose.
* libnm-util: prefix errors with 'setting.property' instead of 'property' onlyJiří Klimeš2013-06-131-7/+7
|
* libnm-util: deprecate 'network-type' and 'allowed-bands' in GSM settingsAleksander Morgado2013-06-051-14/+26
| | | | | | | | When requesting connections to ModemManager, NetworkManager shouldn't try to request specific bands or network types to use. Leave those requests to other system configuration tools talking directly to ModemManager. https://bugzilla.gnome.org/show_bug.cgi?id=701504
* libnm-util: define NM_SETTING_GSM_BANDS_MAX - maximal value for allowed bandsJiří Klimeš2013-05-031-15/+1
| | | | | | | and use it in 'allowed-bands' property installation. The macro NM_SETTING_GSM_BANDS_MAX also allows libnm-util users to check if bands are valid (before setting them).
* libnm-util: fix the maximal value for gsm 'allowed-bands' propertyJiří Klimeš2013-05-031-14/+14
| | | | The bitfields have to be OR-ed with the bitwise |, not ||.
* libnm-util: make property verification errors more descriptiveJiří Klimeš2013-03-131-17/+30
| | | | | | - fix g_set_error()/g_set_error_literal() usage - make the error messages translatable - use g_prefix_error() to prepend property name
* libnm-util: clean up setting registrationDan Williams2012-10-291-1/+6
| | | | | | | | | | | | Make setting type registration less icky; instead of having the connection register all the settings, have the settings themselves register that information at library load time. Putting this sort of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard than the home-rolled stuff we had before. Also document the priority stuff so when adding new settings, people know what priority to use. (cleanups by jklimes)
* all: Don't use ctype.h macrosDan Winship2012-09-261-3/+2
| | | | | | | | | The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use glib's ASCII-only versions instead. Also, replace isascii() with g_ascii_isprint(), since isascii() accepts control characters, which isn't what the code wanted in any of the places where it was using it.
* core: add settings for 4G (LTE) network modesMarius B. Kotsbak2012-09-111-3/+3
| | | | NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G and NM_SETTING_GSM_NETWORK_TYPE_4G added.
* Use glib-mkenums to generate enum typesDan Winship2012-02-151-25/+0
| | | | | | | | | | | | | | | | | | | Rather than generating enum classes by hand (and complaining in each file that "this should really be standard"), use glib-mkenums. Unfortunately, we need a very new version of glib-mkenums in order to deal with NM's naming conventions and to fix a few other bugs, so just import that into the source tree temporarily. Also, to simplify the use of glib-mkenums, import Makefile.glib from https://bugzilla.gnome.org/654395. To avoid having to run glib-mkenums for every subdirectory of src/, add a new "generated" directory, and put the generated enums files there. Finally, use Makefile.glib for marshallers too, and generate separate ones for libnm-glib and NetworkManager.
* libnm-util: allow empty number for gsm settingsThomas Bechtold2012-02-021-7/+1
| | | | | The documentation said they were allowed, and that's clearly the correct behavior.
* trivial: fix GSM setting 'home-only' property nicknameDan Williams2011-10-271-1/+1
|
* docs: update GSM setting documentationDan Williams2011-07-051-13/+93
|
* libnm-util: added missing U2600 GSM band enumerationAleksander Morgado2011-06-131-1/+2
|
* libnm-util: allow _ as a valid character for GSM APNsDan Williams2011-05-171-2/+20
| | | | | | | | | | | The ETSI specs state that valid characters are only ASCII alphanumeric characters, but then state that APNs should generally follow DNS naming rules. Well, that means a lot more characters are allowed, but modems don't like many of them. So let's slowly allow more characters as people find ones that actually are used. The restriction was originally put in place to disallow spaces, because they certainly aren't allowed APN characters and modems and the network puke when they see spaces.
* core: don't require serial and PPP settings for mobile broadbandDan Williams2011-02-251-21/+1
| | | | If they are there, use them. If not, make them up on the fly.
* libnm-util: update CDMA, GSM, and PPPoE settings for NOT_REQUIRED secretsDan Williams2011-02-071-2/+4
|
* libnm-util: NM_SETTING_SECRET_FLAG_SYSTEM_OWNED -> NM_SETTING_SECRET_FLAG_NONEDan Williams2011-02-061-6/+6
| | | | | Make it a bit clearer that this value is not actually a value that can be used as a flag, since its 0x00.
* libnm-util: fix handling of secrets flagsDan Williams2011-01-311-2/+3
| | | | | It's a bitfield, not a single value. Update GObject property max accordingly.
* libnm-util: add secret flags for each secret describing how the secret is storedDan Williams2011-01-291-1/+73
| | | | | | | | | | | | This allows the necessary flexibility when handling secrets; otherwise it wouldn't be known when NM should save secrets returned from agents to backing storage, or when the agents should store the secrets. We can't simply use lack of a secret in persistent storage as the indicator of this, as (for example) when creating a new connection without secrets the storage method would be abmiguous. At the same time, fold in "always ask" functionality for OTP tokens so user agents don't have to store that attribute themselves out-of-band.
* libnm-util: remove deprecated GSM bitsDan Williams2011-01-271-61/+0
|
* libnm-util: silence warningDan Williams2010-11-031-2/+9
|
* libnm-util: fix max APN lengthDan Williams2010-09-221-1/+1
| | | | It's not 20, it's DNS domain name length.
* libnm-util: enforce APN character restrictionsDan Williams2010-09-221-9/+30
| | | | | | | | | | | APNs can only contain alphanumeric characters, '.', and '-'. To be helpful we strip spaces off before setting the APN internally so that previously (and incorrectly) valid APNs don't cause the whole connection to fail validation and thus disappear. The only case seen in the wild was a Pelephone IL APN which erroneously had a trailing space in the mobile broadband provider database. Bad characters cause the connection to fail with vague error messages about being unable to activate the PDP context during PPP negotiation.
* libnm-util: add nm_setting_gsm_get_home_only()Dan Williams2010-03-161-2/+36
| | | | For roaming control.
* doc: document gsm setting propertiesDan Williams2009-11-111-8/+108
|
* libnm-util: ensure GSM setting default valuesDan Williams2009-10-181-0/+2
| | | | Broken by 00f945e54efc112e60ed547c9c7796a7657e4117.
* gsm: correct GSM band implementation and settingsDan Williams2009-10-071-17/+59
| | | | | | | | NM didn't pass it to MM anyway, so it was mainly unused, but the band settings were still wrong. Fix that (and still preserve ABI) by adding a new property for allowed bands that can actually hold all the bands instead of limiting to 16-bits. Clean up some of the deprecation stuff at the same time to make it clearer what's deprecated and what to do about it.
* libnm-util: silence some of the GSM PUK warningsDan Williams2009-09-211-2/+1
|
* libnm-util: deprecate GSM PUK propertyDan Williams2009-09-181-11/+7
| | | | | Unused anyway, and PUK is dangerous enough that it should be handled by the client explicitly and not by NM.
* gsm: fix GSM network mode max valueTorgny Johansson2009-07-101-1/+1
| | | | So that you can actually prefer GSM/EDGE.
* libnm-util: flag properties with G_PARAM_CONSTRUCT so default values get setDan Williams2009-02-011-2/+2
| | | | | | | This caused the 'autoconnect' property of NMSettingConnection to not get updated in some cases (as when a system setting plugin noticed a change to autoconnect=true and emitted the Updated signal, which wouldn't contain the new value). Add a testcase for setting default values too.
* 2008-10-27 Dan Williams <dcbw@redhat.com>Dan Williams2008-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch from Tambet Ingo <tambet@gmail.com> * libnm-util/nm-setting.h libnm-util/nm-setting.c - Make properties private and add accessor functions * libnm-util/nm-connection.c libnm-util/nm-setting-8021x.c libnm-util/nm-setting-cdma.c libnm-util/nm-setting-connection.c libnm-util/nm-setting-gsm.c libnm-util/nm-setting-ip4-config.c libnm-util/nm-setting-ip6-config.c libnm-util/nm-setting-ppp.c libnm-util/nm-setting-pppoe.c libnm-util/nm-setting-serial.c libnm-util/nm-setting-template.c libnm-util/nm-setting-vpn.c libnm-util/nm-setting-wired.c libnm-util/nm-setting-wireless-security.c libnm-util/nm-setting-wireless.c system-settings/plugins/keyfile/reader.c system-settings/plugins/keyfile/writer.c - Use setting accessors git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4228 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-10-26 Dan Williams <dcbw@redhat.com>Dan Williams2008-10-261-46/+136
| | | | | | | | | | | | | | | | | | Patch from Tambet Ingo <tambet@gmail.com> * libnm-util/libnm-util.ver libnm-util/nm-setting-gsm.c libnm-util/nm-setting-gsm.h - Make properties private and add accessor functions * src/nm-gsm-device.c src/nm-hso-gsm-device.c src/ppp-manager/nm-ppp-manager.c - Use those accessors git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4219 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-09-27 Dan Williams <dcbw@redhat.com>Dan Williams2008-09-281-1/+26
| | | | | | | | | * libnm-util/nm-setting-gsm.c - (verify): verify GSM network ID git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4118 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-09-25 Dan Williams <dcbw@redhat.com>Dan Williams2008-09-251-1/+1
| | | | | | | | | | | * libnm-util/nm-setting-gsm.c libnm-util/nm-setting-gsm.h - Fix up NM_GSM_NETWORK_* constants to accurately reflect the network technology terms (bgo #551361) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4106 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-08-04 Dan Williams <dcbw@redhat.com>Dan Williams2008-08-041-0/+34
| | | | | | | | | | | * libnm-util/nm-setting-cdma.c libnm-util/nm-setting-gsm.c - (verify): validate username & password if they exist - (need_secrets): if username given, require a password too git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3892 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-07-27 Dan Williams <dcbw@redhat.com>Dan Williams2008-07-271-1/+24
| | | | | | | | | * libnm-util/* - Relicense to LGPLv2+ git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3859 4912f4e0-d625-0410-9fb7-b9a5a253dbdc