- 03 Apr, 2019 1 commit
-
-
Lubomir Rintel authored
We need this for a little little longer :( This reverts commit 1de8383a.
-
- 12 Feb, 2019 1 commit
-
-
Thomas Haller authored
"nm-macros-interal.h" already includes <errno.h> and <string.h>. No need to include it everywhere else too.
-
- 10 Nov, 2016 1 commit
-
-
Lubomir Rintel authored
This speeds up the initial object tree load significantly. Also, it reduces the object management complexity by shifting the duties to GDBusObjectManager. The lifetime of all NMObjects is now managed by the NMClient via the object manager. The NMClient creates the NMObjects for GDBus objects, triggers the initialization and serves as an object registry (replaces the nm-cache). The ObjectManager uses the o.fd.DBus.ObjectManager API to learn of the object creation, removal and property changes. It takes care of the property changes so that we don't have to and lets us always see a consistent object state. Thus at the time we learn of a new object we already know its properties. The NMObject unfortunately can't be made synchronously initializable as the NMRemoteConnection's settings are not managed with standard o.fd.DBus Properties and ObjectManager APIs and thus are not known to the ObjectManager. Thus most of the asynchronous object property changing code in nm-object.c is preserved. The objects notify the properties that reference them of their initialization in from their init_finish() methods, thus the asynchronously created objects are not allowed to fail creation (or the dependees would wait forever). Not a problem -- if a connection can't get its Settings, it's either invisible or being removed (presumably we'd learn of the removal from the object manager soon). The NMObjects can't be created by the object manager itself, since we can't determine the resulting object type in proxy_type() yet (we can't tell from the name and can't access the interface list). Therefore the GDBusObject is coupled with a NMObject later on. Lastly, now that all the objects are managed by the object manager, the NMRemoteSettings and NMManager go away when the daemon is stopped. The complexity of dealing with calls to NMClient that would require any of the resources that these objects manage (connection or device lists, etc.) had to be moved to NMClient. The bright side is that his allows for removal all of the daemon presence tracking from NMObject.
-
- 19 Feb, 2016 1 commit
-
-
Thomas Haller authored
- 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
-
- 13 Nov, 2014 1 commit
-
-
Dan Winship authored
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.)
-
- 07 Nov, 2014 1 commit
-
-
Dan Winship authored
As with NMIP4Config and NMIP6Config, merge the two DHCP config classes into one in the public API.
-
- 29 Oct, 2014 1 commit
-
-
Dan Winship authored
A parenthesized comment in nm-dbus-interface.h was being misparsed as an annotation. The annotations on NMDhcp4Config:options and NMDhcp6Config:options were incorrect.
-
- 18 Sep, 2014 2 commits
-
-
Dan Winship authored
Port libnm-core/libnm to GDBus. The NetworkManager daemon continues to use dbus-glib; the previously-added connection hash/variant conversion methods are now moved to NetworkManagerUtils (along with a few other utilities that are now only needed by the daemon code).
-
Dan Winship authored
Add _nm_object_class_add_interface(), for declaring that a class implements a particular interface, and then have NMObject create the corresponding proxies itself. (The subclass can get a copy with _nm_object_get_proxy() if it needs it for something). (In GDBus, creating a proxy is a heavier operation than in dbus-glib, so we'll need to create the proxies asynchronously. Moving the creation to NMObject makes that easier since we can do it as part of the existing init/init_async.)
-
- 04 Sep, 2014 1 commit
-
-
Dan Winship authored
The docs for NMIP4Config:addresses and NMIP4Config:routes claimed that they were GPtrArrays of NMIP4Address/NMIP4Route, but get_property() was actually trying to set them the D-Bus representation type, and it was failing anyway because it used g_value_set_boxed() on a parameter that was declared GParamSpecPointer. Fix it to use a GPtrArray-valued property, and set it to the right thing. NMIP6Config did the right thing with its :addresses and :routes properties, but was using custom types (NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY and NM_TYPE_IP6_ROUTE_OBJECT_ARRAY). Make it use G_TYPE_PTR_ARRAY instead. nm-types.c, nm-types.h, and nm-types-private.h are now empty, and so can be dropped.
-
- 01 Aug, 2014 6 commits
-
-
Dan Winship authored
"NetworkManager.h"'s name (and non-standard capitalization) suggest that it's some sort of high-level super-important header, but it's really just low-level D-Bus stuff. Rename it to "nm-dbus-interface.h" and likewise "NetworkManagerVPN.h" to "nm-vpn-dbus-interface.h"
-
Dan Winship authored
Remove _nm_object_ensure_inited(), etc; objects that implement GInitable are now mandatory-to-init(). Remove constructor() implementations that sometimes return NULL; do all the relevant checking in init() instead. Make nm_client_new() and nm_remote_settings_new() take a GCancellable and a GError**.
-
Dan Winship authored
Rather than having each object type override constructed() to call _nm_object_register_properties(), have NMObject call a virtual method on the subclass to ask it to register them. Move some code around in nm-client.c and nm-object.c so that all D-Bus-related initialization happens in init_dbus(), and non-D-Bus-related stuff stays in construct(). (This simplifies the next commit.)
-
Dan Winship authored
Most NMObjects should not be manually created, they should only be received from NMClient or NMRemoteSettings.
-
Dan Winship authored
GLib/Gtk have mostly settled on the convention that two-letter acronyms in type names remain all-caps (eg, "IO"), but longer acronyms become initial-caps-only (eg, "Tcp"). NM was inconsistent, with most long acronyms using initial caps only (Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP, PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all three-or-more-letter-long acronyms (and update nmcli and nmtui for the libnm changes).
-
Dan Winship authored
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/ ]
-
- 15 Jul, 2014 2 commits
-
-
Dan Winship authored
Fix indentation, kill trailing whitespace, split some long lines.
-
Dan Winship authored
- 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.
-
- 19 Jun, 2014 1 commit
-
-
Dan Winship authored
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.
-
- 08 Apr, 2013 1 commit
-
-
Dan Williams authored
When using a private connection, we need to use dbus_g_proxy_new_for_peer() because the bus isn't involved. Since many parts of libnm-glib create a proxy for their corresponding remote object, consolidate the proxy creation logic. A later patch will add logic to use a private connection versus a bus-based one.
-
- 01 Apr, 2013 1 commit
-
-
Dan Williams authored
-
- 27 Feb, 2013 2 commits
-
-
Dan Williams authored
The GOI syntax changed a while back and these didn't follow.
-
Dan Williams authored
This reverts commit 0e0b5da7. Syntax actually uses () instead of <> for various docbook-related reasons.
-
- 26 Feb, 2013 1 commit
-
-
Dan Winship authored
-
- 28 Mar, 2012 1 commit
-
-
Dan Winship authored
We need to do _nm_object_ensure_inited() / _nm_remote_settings_ensure_inited() from the get_property() implementations; in most cases, get_property() just calls another accessor method (which will call _nm_object_ensure_inited()), but in a few places, it reads priv->whatever directly, so we need to make sure that it's valid.
-
- 03 Feb, 2012 3 commits
-
-
Dan Winship authored
Implement GInitable and GAsyncInitable in NMObject, with implementations that synchronously or asynchonously load all properties, and change _nm_object_ensure_inited() to run g_initable_init(). Update the object/object-array property handling to initialize the objects after creating them (synchronously or asynchronously, according to the situation), so that they will have all of their properties preloaded before they are ever visible to the caller. Move the non-blocking/non-failable parts of various objects' constructor() methods to constructed(), and move the blocking/failable parts to init(), and implement init_async() methods with non-blocking versions of the blocking methods. Make nm_device_new() and nm_client_new() call _nm_object_ensure_inited(), to preserve the behaviour formerly enforced by their construct() methods, that properties are guaranteed to be initialized before any signals involving them are emitted.
-
Dan Winship authored
Rather than having every property getter method have code to fetch that specific property's value, just call the new _nm_object_ensure_inited() (which makes sure that we've read all the property values on the object at least once), and then return the cached value. (After we've read the initial property values, the PropertiesChanged signal handler will ensure that the values are kept up to date, so we can always just return cached property values after that point.) This then lets us get rid of _nm_object_get_property() and its wrappers.
-
Dan Winship authored
Rename _nm_object_handle_properties_changed(), etc, to be about properties in general, rather than just property changes. Interpret func==NULL in NMPropertiesInfo as meaning "use _nm_object_demarshal_generic", and then reorder the fields so that you can just leave that field out in the declarations when it's NULL. Add a way to register properties that exist in D-Bus but aren't tracked by the NMObjects, and use that for NMDevice's D-Bus Ip4Address property, replacing the existing hack. Also add a few other missing properties noticed along the way.
-
- 10 Mar, 2011 1 commit
-
-
Dan Williams authored
-
- 22 Feb, 2011 1 commit
-
-
Giovanni Campagna authored
Fix some annotations and add the necessary ones for new functions.
-
- 15 Feb, 2011 1 commit
-
-
Jiří Klimeš authored
It allows us to get the error back and have control over printing the error.
-
- 21 Jan, 2011 1 commit
-
-
Giovanni Campagna authored
Add the necessary annotations (the mininum required, that is those on return values. NULL parameters or container types may require more), and the Autotools stuff to get a NetworkManager GIR for libnm-util and a NMClient for libnm-glib.
-
- 03 Aug, 2010 1 commit
-
-
Dan Williams authored
Busted since 2008 apparently. Oops.
-
- 27 Nov, 2008 1 commit
-
-
Dan Williams authored
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4344 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
- 14 Nov, 2008 1 commit
-
-
Dan Williams authored
Relicense libnm-glib to LGPLv2+ with agreement from contributors git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
- 05 Sep, 2008 1 commit
-
-
Dan Williams authored
* libnm-glib/nm-ip4-config.c libnm-glib/nm-dhcp4-config.c - (finalize): clean up the DBusGProxy git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4038 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
- 26 Aug, 2008 1 commit
-
-
Michael Biebl authored
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4012 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
- 12 Aug, 2008 1 commit
-
-
Tambet Ingo authored
* libnm-glib/*.c. Document some more. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3934 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
- 07 Aug, 2008 2 commits
-
-
Dan Williams authored
* callouts/nm-dispatcher-action.c - (nm_dispatcher_action): grab device path and create the device; pass the device's DHCP4 config to script caller - (dispatch_scripts): dump the DHCP4 config to the environment of called scripts * libnm-glib/nm-dhcp4-config.c libnm-glib/nm-dhcp4-config.h - (nm_dhcp4_config_get_options): expose - (nm_dhcp4_config_get_one_option): renamed from nm_dhcp4_config_get_option git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3907 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-
Dan Williams authored
* include/NetworkManager.h - Add the DHCP4Config D-Bus interface * libnm-glib/Makefile.am libnm-glib/nm-dhcp4-config.c libnm-glib/nm-dhcp4-config.h - Handle DHCP4 config objects exported by NM over D-Bus * libnm-glib/nm-device.c libnm-glib/nm-device.h - Add a 'dhcp4-config' property * libnm-glib/libnm-glib-test.c - Print out DHCP4 config for devices - Fix some crashes when no connections are active * src/nm-device-interface.c src/nm-device.c src/nm-dhcp4-config.c src/nm-dhcp4-config.h - Treat dhcp4-config object as an object path at the D-Bus interface so that when it doesn't exist we can proxy it as "/" which dbus-glib doesn't let us do when the property type is G_TYPE_OBJECT git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3905 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-