summaryrefslogtreecommitdiff
path: root/libnm-util
Commit message (Collapse)AuthorAgeFilesLines
* libnm-util: properly disconnect "notify" signal for settings in NMConnectionThomas Haller2014-08-221-13/+19
| | | | | | | | | | When removing/replacing a NMSetting in an NMConnection, we have to disconnect setting_changed_cb() from the "notify" signal. Backport commit dfba4ce1e1c5bd0c1ae798bc538b5fab3e3faded from libnm-core. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-core: fix NMSettingConnection:verify() not to modify interface-nameThomas Haller2014-08-221-1/+1
| | | | | | | | | | | | | verify() used to modify interface-name of the base settings. This is discouraged, because verify() should not touch the connection. For libnm-core we can change behavior and only modify the connection in normalize(). Also, be more strict not to verify() sucessfully on invalid interface-name. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-core: add normalize of MTU for NMSettingInfinibandThomas Haller2014-08-221-0/+1
| | | | | | | | | | | | | | | | | Previously, NMSettingInfiniband:verify() silently modifies the setting for invalid MTU. verify() should not do that. For libnm-core we can change behavior and implement normalization of MTU. This changes behavior for NMSettingInfiniband:verify() so that MTU gets no longer fixed by verify() alone. Instead verify() fails with a verification error. Due the possibility to normalize the MTU, NM still can receive invalid settings and fix it. For libnm-core we don't change behavior, merely add a code comment. Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: don't shadow rand(3)Dan Williams2014-08-201-5/+5
| | | | | | Reported by Jordan Messina (cherry picked from commit 365ca198c0d688e759cd2481d9446ba16f8e78ca)
* libnm-core: fix crash in NMSettingAdsl:verify()Thomas Haller2014-08-191-6/+8
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: fix generate-setting-docs.py to work with python3Thomas Haller2014-08-121-3/+5
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: don't warn about unrecognized propertiesDan Winship2014-08-081-2/+4
| | | | | | | | | | libnm-util is expected to end up behind the curve in terms of knowing about new NMSetting properties, so if it sees an unknown property, it should just assume that there will also be a backward-compatibility equivalent rather than printing a warning. (In particular, it should not warn when it sees the "ipv4.address-labels" property now that it now longer knows about it.)
* libnm-core, libnm-util: convert test-crypto, test-setting-8021x.c to gtestutilsDan Winship2014-08-073-130/+173
| | | | | | | | | | | Rather than having test-crypto and test-setting-8021x be programs that you have to pass arguments to to get them to run a single test, just have them run all of the tests themselves. This lets us get rid of the big "check-local" rule in Makefile.am and just use TESTS to run everything. https://bugzilla.gnome.org/show_bug.cgi?id=734388
* libnm-util/test: fix tests not to write a core fileThomas Haller2014-08-041-1/+23
| | | | | | | | | | | | | | | | | test_libnm_linking() executes ./test-libnm-linking which is supposed to crash. When the user set `ulimit -c unlimited` before, this will leave a left-over core file. In case of `make distcheck`, this is quite bad because it lets the make target fail: ERROR: files left in build directory after distclean: ./libnm-util/tests/core.31481 Fix this by setting the (soft) rlimit for writing core files to 0 before executing the test binary. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util/tests: fix build for older glib with unknown G_SPAWN_DEFAULTThomas Haller2014-08-041-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util/test: fix build for clang due to deprecated warningThomas Haller2014-08-011-0/+2
| | | | | | | For clang, we have to include nm-glib-compat.h to redefine G_GNUC_BEGIN_IGNORE_DEPRECATIONS. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm, libnm-utils: error out if mixed libnm/libnm-util symbols are detectedDan Winship2014-08-014-1/+93
| | | | | If a program accidentally ends up linking in both libnm and libnm-util (presumably via different dependencies), error out immediately.
* libnm-util: remove NM_UTIL_PRIVATE_CALL, NMSettingIP4Config:address-labelsDan Winship2014-08-015-322/+17
| | | | | | Since libnm-util is no longer used from within NM, its copy of NM_UTIL_PRIVATE_CALL is now useless, and the internal-only NMSettingIP4Config:address-labels property is no longer needed.
* libnm-util, core: fix warning about signed integer overflow (-Wstrict-overflow)Thomas Haller2014-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc warns: make[4]: Entering directory `./NetworkManager/libnm-util' CC nm-value-transforms.lo nm-value-transforms.c: In function '_nm_utils_convert_op_array_to_string': nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (i > 0) ^ nm-value-transforms.c: In function '_nm_utils_convert_string_array_to_string': nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (i > 0) ^ make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh' CC reader.lo reader.c: In function 'make_wired_setting': reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (!found) ^ reader.c: In function 'wireless_connection_from_ifcfg': reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (!found) ^ Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: fix warning converting between enum types in nm-setting-8021x.cThomas Haller2014-08-011-2/+7
| | | | | | | | | | | | | | | clang warns: make[4]: Entering directory `./NetworkManager/libnm-util' CC nm-setting-8021x.lo nm-setting-8021x.c:1824:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion] *out_format = format; ~ ^~~~~~ nm-setting-8021x.c:2135:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion] *out_format = format; ~ ^~~~~~ Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: clean nm-version.hDan Williams2014-07-311-1/+1
| | | | | | | | Now that nm-version.h.in lives in libnm-util/, a stale nm-version.h from include/ messes up the build with errors about NM_VERSION_*. Clean both old & new nm-version.h on 'make clean' so that we can switch branches between nm-0-9-8, nm-0-9-10, and git master and just run 'make clean' and get things to work.
* libnm-util: fix enum member names in a gtk-doc commentDan Winship2014-07-231-7/+7
|
* libnm-util: fix gtk-doc syntax in nm-version.h to avoid a warningDan Winship2014-07-231-1/+1
|
* platform: assert against the maximum length of link_get_address()Thomas Haller2014-07-231-3/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* include: add NM_DEVICE_CAP_IS_SOFTWARE capabilityJiří Klimeš2014-07-221-2/+4
| | | | for marking software devices.
* libnm-util: fix leak in _nm_connection_verify()Thomas Haller2014-07-151-1/+1
| | | | | | Regression introduced by commit 2570c5a17ceab3eb39695493b07144cba04eadbf. Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: more srcdir!=builddir fixesDan Winship2014-07-152-4/+4
| | | | | | | | nm-version.h was getting disted, making srcdir!=builddir work for tarball builds, but not for git builds. Also, remove "-I${top_builddir}/include" from all Makefile.ams, since there's nothing generated in include/ any more.
* libnm-util: NetworkManager.h/NetworkManagerVPN.h doc fixupsDan Winship2014-07-152-123/+159
| | | | | | | | Add gtk-docs for enum types that previously didn't have them. Explicitly note the relationship between NetworkManager.h / NetworkManagerVPN.h types and the corresponding introspection/*.xml types.
* libnm-util, libnm-glib: whitespace fixesDan Winship2014-07-1543-350/+490
| | | | Fix indentation, kill trailing whitespace, split some long lines.
* libnm-util, libnm-glib: standardize copyright/license headersDan Winship2014-07-1572-280/+118
| | | | | | | | | | | | | | | | | | - 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, libnm-glib: tweak (element-type) annotations in docsDan Winship2014-07-151-4/+4
| | | | | | | g-i allows you to specify types in annotations using either their fully-qualified introspected names (eg, "NMClient.Device") or their plain C names ("NMDevice"). Switch from the former to the latter (so that they'll still be correct when migrated to libnm later).
* libnm-util: move NetworkManager.h, etc, from include/ to hereDan Winship2014-07-154-4/+967
| | | | | | | | NetworkManager.h, NetworkManagerVPN.h, and nm-version.h are part of the libnm-util API, so move them to libnm-util. include/ still contains headers that are strictly NM-internal (eg, nm-glib-compat.h).
* libnm-util: fix build with --with-crypto=gnutlsDan Winship2014-07-111-3/+3
| | | | | | The non-"_t"-suffixed type names in gnutls have been deprecated since 1.x, and in recent versions will trigger deprecation warnings. Fix by using "gnutls_datum_t" instead of "gnutls_datum".
* trivial: add a missing word to documentationDan Winship2014-07-071-1/+1
|
* build: call generate-setting-docs.py directly instead of through straceThomas Haller2014-07-041-1/+1
| | | | | | | This was added for debugging, but is no longer necessary. Also, strace might not be installed on any system so don't depend on it. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: merge nm-util-private and nm-utils-privateDan Williams2014-07-027-118/+85
| | | | | No reason to have two differently named files for the same general purpose.
* docs: fix multi-line Since notationDan Williams2014-07-011-1/+2
|
* libnm-util: normalize IP settings in connectionThomas Haller2014-06-303-31/+97
| | | | | | | | | | This is the same behaviour as nm_utils_normalize_connection(), which will soon be removed in favor of nm_connection_normalize(). This takes care, that normal connections always have an IP4 and IP6 setting, and that slave connections never have it. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: validate master/slave-type property in NMSettingConnection::verify()Thomas Haller2014-06-301-4/+32
| | | | | | | | | | | - Before, when setting the slave-type to an invalid type, the setting was silently accepted. Now verification fails with "Unknown slave type '%s'" - Before, the @master property was not checked. So you could have a @slave-type, without having @master set. And similarly, you could have @master, but no @slave-type. Fix both issues. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: normalize virtual_iface_name in NMSettingsThomas Haller2014-06-3010-96/+316
| | | | | | | | | | | | | | | | | | | | Some type-specific NMSetting implementations (bond, bridge, team, vlan) have their own 'interface-name' property. This property will be deprecated in favour of 'interface-name' in NMSettingConnection. Change verify() and normalize() to check that the redundant values match and repair/normalize the properties. Force the virtual interface name of the type-specific setting to be equal to NMSettingConnection:interface_name. This way, the depreacted field stays valid and backward compatible. NMSettingInfiniband is special, because it does not have a backing property for the interface name, although it implements get_virtual_iface_name(). To account for this, some special handling is needed in order not to change the behaviour of get_virtual_iface_name(). Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add function nm_connection_normalizeThomas Haller2014-06-306-22/+195
| | | | | | | | | | | This function behaves like verify(), but it also performs some normalization/fixing of inconsistent connections. Contrary to verify(), this function might modify the settings. This will be mainly used, to repair connections from older versions and to fix deprecated options. Signed-off-by: Thomas Haller <thaller@redhat.com>
* test: nm_connection_verify() sets the interface-name to virtual_iface_name.Thomas Haller2014-06-301-0/+44
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add function nm_connection_get_interface_name()Thomas Haller2014-06-304-1/+34
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: 'nm-setting-docs.xml' must depend on 'NetworkManager-1.0.typelib'Thomas Haller2014-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Build of 'nm-setting-docs.xml' must depend on 'NetworkManager-1.0.typelib', otherwise 'NetworkManager-1.0.typelib' is not yet created and './generate-setting-docs.py' fails. g-ir-scanner: compile: gcc -Wall -Wno-deprecated-declarations -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmiss g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC gcc -o /NetworkManager/libnm-util/tmp-introspectEda05I/NetworkManager-1.0 -export-dynamic -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclarat libtool: link: gcc -o /NetworkManager/libnm-util/tmp-introspectEda05I/.libs/NetworkManager-1.0 -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wformat-security -Wfloat-equal -Wn export GI_TYPELIB_PATH=/NetworkManager/libnm-util${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=/NetworkManager/libnm-util/.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}; \ strace -o /tmp/strace.out ./generate-setting-docs.py \ --gir ./NetworkManager-1.0.gir \ --output nm-setting-docs.xml ERROR:root:Could not find any typelib for NetworkManager Traceback (most recent call last): File "./generate-setting-docs.py", line 19, in <module> from gi.repository import NetworkManager, GObject ImportError: cannot import name NetworkManager make[4]: *** [nm-setting-docs.xml] Error 1 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: build nm-setting-docs.xml against uninstalled libnm-utilDan Winship2014-06-271-1/+3
| | | | | | Set GI_TYPELIB_PATH and LD_LIBRARY_PATH so that we build nm-setting-docs.xml against the just-built typelib and .so, not the installed ones.
* build: fix nm-setting-docs build in various configurationsDan Winship2014-06-271-0/+4
| | | | | | | Certain build configurations (like --enable-gtk-doc --disable-introspection) were broken with respect to nm-setting-docs. Fix this. Also, we don't require just gobject-introspection, we need pygobject specifically as well.
* build: fix multiple definitions of DISTCLEANFILESDan Williams2014-06-261-1/+1
| | | | Multiple definitions added by dcc109516d4e8706836031ad175ce9176f7c3c72
* libnm-util: document "address-labels" property as for internal use onlyJiří Klimeš2014-06-261-0/+5
|
* all: remove remaining GParamSpec name/blurb stringsDan Winship2014-06-191-5/+4
| | | | | | Remove all remaining GParamSpec name and blurb strings (and fix indentation while we're there), and add G_PARAM_STATIC_STRINGS to all paramspecs that were lacking it.
* libnm-util: remove NMSetting* GParamSpec docsDan Winship2014-06-1926-1789/+840
| | | | | | | | | | | | 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: build nm-setting-docs.xml from gtk-doc and GParamSpecsDan Winship2014-06-192-0/+204
| | | | | | | | Add generate-setting-docs.py, based on tools/generate-settings-spec.c, which generates a simple XML file describing all libnm setting properties (still getting the default values via GParamSpec introspection like generate-settings-spec.c does, but getting the documentation out of the gtk-doc strings in the GIR file instead).
* libnm-util: various NMSetting* property doc fixes/improvementsDan Winship2014-06-1926-386/+494
| | | | | | | | | | 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-1910-45/+45
| | | | | | | | 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, libnm-glib: be consistent about "Wi-Fi", "Ethernet", ↵Dan Winship2014-06-1911-60/+60
| | | | | | | | | "InfiniBand" in docs We made the UIs consistent last year, but missed the documentation. Fix the docs to also consistently use "Wi-Fi" rather than "WiFi", "Wifi", "wifi", or "WiFI"; "Ethernet" rather than "ethernet"; and "InfiniBand" rather than "Infiniband".
* misc: remove some dead codeDan Winship2014-06-121-4/+2
| | | | | | The G_DISABLE_CHECKS version of g_return_if_reached() still returns, it just doesn't log. So don't include a manual return after a return-if-reached.