summaryrefslogtreecommitdiff
path: root/libnm-glib
Commit message (Collapse)AuthorAgeFilesLines
...
* libnm-glib/test: add asserts to test-remote-settings-clientThomas Haller2014-08-011-1/+11
| | | | | | | | | - register a weak references and ensure that the connection is removed when expected. - disconnect the vis_new_connection_cb() handler Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib/test: fix crash in test-remote-settings-clientThomas Haller2014-08-011-0/+2
| | | | | | | | | test_make_invisible() forgot to disconnect handler invis_removed_cb(). Later, during test_remove_connection(), the connection will be eventually removed and the callback will corrupt the stack by writing to the '&done' user data. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: disconnect the connectivity check cancellable signal after the ↵Giovanni Campagna2014-07-311-0/+5
| | | | | | | | | | | | call has ended (bgo #733915) We cannot rely on connectivity data freeing to disconnect the signal, because the simple async result might be kept alive by external code (for example the language runtime for JS), but we must not call dbus_g_proxy_cancel_call() if that cancellable is cancelled or reused afterwards. https://bugzilla.gnome.org/show_bug.cgi?id=733915
* tools: move libnm-glib's fake NM service implementations hereDan Winship2014-07-303-934/+5
| | | | | | | | | | Move libnm-glib's test-fake-nm.py and test-remote-settings-service.py to tools/, merge them together into a single program, and fix a few bugs (notably some missing signal emissions in the Settings service). Although they are currently only used by libnm-glib's tests, they are generic enough that they could be used by other code in the future (and in particular, they will be used by libnm's tests as well).
* libnm-glib: fix gtk-doc for NMClient:active-connectionsThomas Haller2014-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since previous commit dafe51e8819c31ef6c0a7e901e43e821e229650f, the gtk-doc is no longer ignored. However, the angle brackets add invalid XML characters to ./docs/libnm-glib/xml/nm-client.xml This breaks the build. make[3]: Entering directory `./NetworkManager/docs/libnm-glib' DOC Scanning header files DOC Introspecting gobjects DOC Building HTML ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: NMActiveConnection line 1109 and para </para></refsect2> ^ ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: para line 1107 and refsect2 </para></refsect2> ^ ../xml/nm-client.xml:1211: parser error : Opening and ending tag mismatch: refsect2 line 1104 and refsect1 </refsect1> ^ ../xml/nm-client.xml:1262: parser error : Opening and ending tag mismatch: refsect1 line 1095 and refentry </refentry> ^ ../xml/nm-client.xml:1263: parser error : Premature end of data in tag refentry line 7 ^ ../libnm-glib-docs.xml:67: element include: XInclude error : could not load ../xml/nm-client.xml, and no fallback was found make[3]: *** [html-build.stamp] Error 6 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: document some propertiesDan Winship2014-07-256-10/+65
| | | | | | | | Some libnm-glib object properties were only documented in the GParamSpec strings, not via gtk-doc comments, so they became undocumented when the paramspec strings went away. Fix that. (Also fix incorrect gtk-doc syntax with several NMClient properties.)
* libnm-glib: implement nm_device_delete() for D-Bus device' Delete() methodJiří Klimeš2014-07-223-14/+58
|
* libnm-glib: add nm_device_is_software() function to NMDeviceJiří Klimeš2014-07-223-0/+22
| | | | It says whether the device is a software one, according to device capabilities.
* libnm-glib: evaluate assert check only once in test-remote-settings-clientThomas Haller2014-07-211-2/+5
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: fix assertion-failure messages in test-remote-settings-clientDan Winship2014-07-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | test-remote-setting-client uses a macro: #define test_assert(condition) \ do { \ if (!G_LIKELY (condition)) \ cleanup (); \ g_assert (condition); \ } while (0) where cleanup() kills the fake remote-settings service and unrefs settings. However, in many cases, "condition" would involve a test against a connection that was owned by settings, so if the check failed, the connection would end up getting freed by cleanup(), and so then the second invocation of condition would result in the program aborting on a failed check somewhere else (eg, "invalid unclassed pointer in cast to 'NMConnection'") rather than displaying the failed assertion that had gotten us to that point. Fix this by not unreffing settings from cleanup(); in the normal exit case we can just have main() unref it, and in the assertion-failed case, we don't need to free things anyway.
* build: more srcdir!=builddir fixesDan Winship2014-07-152-2/+0
| | | | | | | | 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-glib: drop separate test libraryDan Winship2014-07-155-32/+17
| | | | | | | | Previously, we built a second copy of libnm-glib that was hacked to use the session bus rather than the system bus, for use by the test programs. Rather than doing that, just have test-nm-client explicitly override the choice of bus. (test-remote-settings-client was actually already doing this, although it leaked the bus after.)
* libnm-util, libnm-glib: whitespace fixesDan Winship2014-07-1535-218/+206
| | | | Fix indentation, kill trailing whitespace, split some long lines.
* libnm-util, libnm-glib: standardize copyright/license headersDan Winship2014-07-1572-240/+110
| | | | | | | | | | | | | | | | | | - 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-1513-23/+23
| | | | | | | 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).
* trivial/libnm-glib: rename internal PROP_* enum valuesThomas Haller2014-07-141-8/+8
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: fix initialization of NMObject typeThomas Haller2014-07-141-7/+4
| | | | | | | | | | | | | | | | | | Ensure that the @type_funcs and @type_async_funcs hashes are initialized before running the class init function. libnm-glib-scan hits the following assertion: GLib-CRITICAL **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed #0 0x0000003370c504e9 in g_logv (log_domain=0x3370cb2f4e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffd1578f70) at gmessages.c:989 #1 0x0000003370c5063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025 #2 0x00007f2169f42545 in _nm_object_register_type_func (base_type=base_type@entry=13597296, type_func=type_func@entry=0x7f2169f47ae9 <_nm_device_type_for_path>, type_async_func=type_async_func@entry= 0x7f2169f47880 <_nm_device_type_for_path_async>) at nm-object.c:551 #3 0x00007f2169f48664 in nm_device_get_type () at nm-device.c:62 #4 0x0000000000402577 in get_object_types () at libnm-glib-scan.c:46 #5 0x0000000000404b0b in main (argc=<optimized out>, argv=<optimized out>) at libnm-glib-scan.c:135 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib/tests: remove waiting time for initializing NMClientThomas Haller2014-07-081-16/+0
| | | | | | This waiting time significantly increases the runtime of the tests. Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: remove remaining GParamSpec name/blurb stringsDan Winship2014-06-1929-666/+525
| | | | | | 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, libnm-glib: be consistent about "Wi-Fi", "Ethernet", ↵Dan Winship2014-06-198-28/+28
| | | | | | | | | "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".
* libnm-glib: don't use deprecated nm_access_point_get_hw_address()Thomas Haller2014-06-071-1/+1
| | | | | | | | | nm_access_point_get_hw_address() is already deprecated since pre-0.9.0-beta3 (f30e15a04d56a922f50e20c3c155a452d635a187). However, it also is defined as NM_DEPRECATED_IN_0_9_10, because there are no deprecated macros for previous version. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib-vpn: bump soname (1.1.0 -> 1.2.0) for API additionsDan Williams2014-06-061-1/+1
|
* libnm-glib: bump soname (4.7.0 -> 4.8.0) for API additionsDan Williams2014-06-061-1/+1
|
* libnm-glib: fix double unref() when object creation failsJiří Klimeš2014-06-051-6/+7
|
* libnm-glib: fix resetting IP config during additional SetConfig() callsThomas Haller2014-06-041-20/+18
| | | | | | | | | | | When receiving updated VPN IP configuration from the helper after the initial connect event, the library overwrites the already initialized GValue fields by calling g_value_init() again. This is an error and causes the following warning: (nm-openvpn-service:27645): GLib-GObject-WARNING **: gvalue.c:183: cannot initialize GValue with type gchararray, the value has already been initialized as gchararray Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: g_type_init() has been deprecated in GLib 2.35.0Jiří Klimeš2014-05-274-0/+9
| | | | | g_type_init() deprecation: https://bugzilla.gnome.org/show_bug.cgi?id=686161
* docs: clarify some uses of nm_active_connection_get_connection()Dan Williams2014-05-221-3/+6
|
* all: set G_LOG_DOMAIN appropriately, for better g_log() messagesDan Winship2014-04-231-0/+1
|
* libnm-glib: add documentation for NMRemoteSettings and connection additionDan Williams2014-04-101-1/+95
|
* build: add some missing -DNM_VERSION_MAX_ALLOWEDDan Winship2014-04-071-0/+1
| | | | | Add -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE to a bunch of Makefile.ams that were missing it and might eventually need it.
* trivial: make clear the maximum bitrate is in kbit/sJiří Klimeš2014-04-012-6/+6
|
* libnm-glib: add nm_device_get_setting_type()Dan Winship2014-03-0616-1/+124
| | | | | Add a function mapping NMDevices to their corresponding base NMSetting types.
* libnm-glib: fix a double free in NMDeviceVlanDan Winship2014-03-051-1/+0
|
* libnm-glib: support 'type', 'id' properties in NMActiveConnection (rh #1061822)Jiří Klimeš2014-03-053-0/+92
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1061822
* libnm-glib: fix glib-mkenums warningsDan Winship2014-02-281-2/+2
| | | | | glib-mkenums doesn't parse /*< public >*/ and /*< private >*/, and in fact, it warns about them, so don't write it that way.
* replace snprintf by g_snprintfThomas Haller2014-02-241-2/+1
| | | | | | Use the glib wrapper for snprintf. Signed-off-by: Thomas Haller <thaller@redhat.com>
* docs: use %TRUE, %FALSE macros instead of plain TRUE, FALSE values for gtkdocJiří Klimeš2014-02-241-2/+2
|
* libnm-glib: take reference in NMRemoteConnection before calling DBUSThomas Haller2014-02-213-80/+170
| | | | | | | | | | We always have to take a reference to the NMRemoteConnection before calling to DBUS, because the connection might be deleted in the meantime. https://bugzilla.gnome.org/show_bug.cgi?id=723168 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: accept omitting callback in nm_remote_connection_*Thomas Haller2014-02-211-3/+0
| | | | | | | | | The functions nm_remote_connection_save(), nm_remote_connection_commit_changes(), and nm_remote_connection_commit_changes_unsaved() indicate in the documentation, that they allow omitting the callback argument. Remove invalid checks for callback. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util, libnm-glib: add versioned deprecation/availability macrosDan Winship2014-02-1315-0/+40
| | | | | | | | | | | | | | | | Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag new/deprecated functions accordingly. (All currently-deprecated functions are assumed to have been deprecated in 0.9.10.) Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which can be set to determine which versions will cause warnings. With the current settings, external consumers of the libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both set to NM_VERSION_0_9_8 by default, meaning they will get warnings about functions added in 0.9.10. NM internally sets NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is always allowed to use all APIs.
* libnm-util, libnm-glib: add some missing "Since: 0.9.10" tagsDan Winship2014-02-132-0/+12
| | | | | Based on diffing libnm-util.ver and libnm-glib.ver with their 0.9.8 versions.
* libnm-glib: suppress warnings unless LIBNM_GLIB_DEBUG is setDan Williams2014-02-131-41/+36
| | | | | | | | Most of these warnings are things libnm-glib can't do anything about, and they are pretty annoying when running nmcli or nmtui, and libraries usually shouldn't print random warnings anyway. So downgrade them to debug messages that can be enabled if we need to see them.
* libnm-glib: zero 'secrets' to prevent crash getting secretsDan Williams2014-01-311-1/+1
| | | | | | If the GetSecrets call returned an error (eg, no secrets) then 'secrets' isn't set by dbus_g_proxy_end_call() and is garbage, then gets freed.
* libnm-glib: fix leak in nm_remote_connection_get_secretsThomas Haller2014-01-301-0/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: add function nm_remote_settings_get_connection_by_id()Thomas Haller2014-01-273-0/+43
| | | | | | | Utility function, to search the list of connections for a connection with a matching id/name. Returns the first match. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util, libnm-glib: add device/connection describing functionsDan Winship2014-01-273-10/+453
| | | | | Add functions to describe and disambiguate devices and connections for display to the user. Originally from libnm-gtk.
* libnm-glib: chain up the parent constructed() of NMRemoteConnectionJiří Klimeš2014-01-271-0/+2
|
* trivial: remove unused #definesDan Williams2014-01-2316-71/+0
| | | | | These are no longer used by anything, but are determined automatically from the GObject property names.
* libnm-glib: add testing framework and testcasesDan Williams2014-01-233-3/+1744
| | | | | Add a fake NM service and test various aspects of the new NM D-Bus properties.
* libnm-glib: remove unused pseudo-property codeDan Williams2014-01-232-240/+1
| | | | | Now that all previous pseudo-properties have been converted to real D-Bus and GObject properties, we can remove this code.