summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-ip6-config.c
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core: merge NMSetting*Error into NMConnectionErrorDan Winship2014-10-221-33/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each setting type was defining its own error type, but most of them had exactly the same three errors ("unknown", "missing property", and "invalid property"), and none of the other values was of much use programmatically anyway. So, this commit merges NMSettingError, NMSettingAdslError, etc, all into NMConnectionError. (The reason for merging into NMConnectionError rather than NMSettingError is that we also already have "NMSettingsError", for errors related to the settings service, so "NMConnectionError" is a less-confusable name for settings/connection errors than "NMSettingError".) Also, make sure that all of the affected error messages are localized, and (where appropriate) prefix them with the relevant property name. Renamed error codes: NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET Remapped error codes: NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY Dropped error codes (were previously defined but unused): NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
* libnm: make use of GParamSpecFlags and GParamSpecEnumDan Winship2014-10-031-9/+9
| | | | | | | | | | Make enum- and flags-valued properties use GParamSpecEnum and GParamSpecFlags, for better introspectability/bindability. This requires no changes outside libnm-core/libnm since the expected data size is still the same with g_object_get()/g_object_set(), and GLib will internally convert between int/uint and enum/flags GValues when using g_object_get_property()/g_object_set_property().
* libnm-core: change connection hash tables to variants in APIDan Winship2014-09-181-11/+48
| | | | | | | | | | In preparation for porting to GDBus, make nm_connection_to_dbus(), etc, represent connections as GVariants of type 'a{sa{sv}}' rather than as GHashTables-of-GHashTables-of-GValues. This means we're constantly converting back and forth internally, but this is just a stepping stone on the way to the full GDBus port, and all of that code will go away again later.
* libnm-core: improve NMSettingIP4Config / NMSettingIP6Config property typesDan Winship2014-09-041-56/+99
| | | | | | | | Make the :addresses and :routes properties be GPtrArrays of NMIP4Address, etc, rather than just reflecting the D-Bus data. Make the :dns properties be arrays of strings rather than arrays of binary IP addresses (and update the corresponding APIs as well).
* libnm-core: change list-of-string and array-of-string properties to G_TYPE_STRVDan Winship2014-09-041-3/+4
| | | | | | | | | Change all DBUS_TYPE_G_LIST_OF_STRING and DBUS_TYPE_G_ARRAY_OF_STRING properties to G_TYPE_STRV, and update everything accordingly. (This doesn't actually require using _nm_setting_class_transform_property(); dbus-glib is happy to transform between 'as' and G_TYPE_STRV.)
* libnm-core: drop NMParamSpecSpecialized, add nm_property_compare()Dan Winship2014-09-041-19/+18
| | | | | | | | | | | | | | | | | | | | NMParamSpecSpecialized existed basically to provide a version of GParamSpecBoxed that could compare dbus-glib-valued properties correctly. However, g_param_values_cmp() was only used by NM directly in one place (NMSetting's compare_property()), and we don't actually need to indirect through GParamSpec there; we could just call NMParamSpecSpecialized's value-comparison function directly. So, change all NMParamSpecSpecialized properties to GParamSpecBoxed, rename the _gvalues_compare() function it used to "nm_property_compare()", and use that from NMSetting. (g_param_values_cmp() also gets used internally by g_param_value_defaults(), but all NMParamSpecSpecialized properties have a default value of NULL, so GParamSpecBoxed's pointer-equality check will do the job just fine there.)
* libnm-core: simplify _nm_register_setting(), register error types tooDan Winship2014-09-041-4/+1
| | | | | | | | Simplify the use of _nm_register_setting() by having it splice together various symbol names itself rather than requiring them to be specified explicitly, and extend it to also ensure that the type's corresponding error type is registered (allowing one to find it via g_type_from_name() if necessary).
* libnm: add NetworkManager.h, disallow including individual headersDan Winship2014-08-011-1/+0
| | | | | | | | | | Add NetworkManager.h, which includes all of the other NM header, and require all external users of libnm to use that rather than the individual headers. (An exception is made for nm-dbus-interface.h, nm-vpn-dbus-interface.h, and nm-version.h, which can be included separately.)
* libnm: remove Since tags and NM_AVAILABLE_IN_* attributesDan Winship2014-08-011-12/+0
| | | | Everything currently in libnm has always been there.
* libnm: add libnm/libnm-core (part 1)Dan Winship2014-08-011-0/+1683
This commit begins creating the new "libnm", which will replace libnm-util and libnm-glib. The main reason for the libnm-util/libnm-glib split is that the daemon needs to link to libnm-util (to get NMSettings, NMConnection, etc), but can't link to libnm-glib (because it uses many of the same type names as the NetworkManager daemon. eg, NMDevice). So the daemon links to only libnm-util, but basically all clients link to both. With libnm, there will be only a single client-visible library, and NetworkManager will internally link against a private "libnm-core" containing the parts that used to be in libnm-util. (The "libnm-core" parts still need to be in their own directory so that the daemon can see those header files without also seeing the ones in libnm/ that conflict with its own headers.) [This commit just copies the source code from libnm-util/ to libnm-core/, and libnm-glib/ to libnm/: mkdir -p libnm-core/tests/ mkdir -p libnm/tests/ cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/ rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch] cp libnm-util/tests/*.[ch] libnm-core/tests/ cp libnm-glib/*.[ch] libnm/ rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch] cp libnm-glib/tests/*.[ch] libnm/tests/ ]