Find a file
Thomas Haller 4e0f1b16b9 libnm: add generic-data for implementing NMSetting
Add a new way how NMSetting subclasses can be implemented.

Currently, most NMSetting implementations realize all their properties
via GObject properties. That has some downsides:

 - the biggest one, is the large effort to add new properties.
   Most of them are implemented on a one-by-one basis and they come
   with additional API (like native getter functions).
   It makes it cumbersome to add more properties.

 - for certain properties, it's hard to encode them entirely in
   a GObject property. That results in unusable API like
   NM_SETTING_IP_CONFIG_ADDRESSES, NM_SETTING_BOND_OPTIONS,
   NM_SETTING_USER_DATA. These complex valued properties only
   exist, because we currently always need GObject properties
   to even implement simple functionality. For example,
   nm_setting_duplicate() is entirely implemented via
   nm_setting_enumerate_values(), which can only iterate
   GObject properies. There is no reason why this is necessary.
   Note also how nmcli badly handles bond options and VPN
   data. That is only a shortcoming of nmcli and wouldn't
   need to be that way. But it happend, because we didn't
   keep an open mind that settings might be more than just
   accessing GObject properties.

 - a major point of NMSetting is to convert to/from a GVariant
   from the D-Bus API. As NMSetting needs to squeeze all values
   into the static GObject structure, there is no place to
   encode invalid or unknown properties. Optimally,
   _nm_setting_new_from_dbus() does not loose any information
   and a subsequent _nm_setting_to_dbus() can restore the original
   variant. That is interesting, because we want that an older
   libnm client can talk to a newer NetworkManager version. The
   client needs to handle unknown properties gracefully to stay
   forward compatible. However, it also should not just drop the
   properties on the floor.
   Note however, optimally we want that nm_setting_verify() still
   can reject settings that have such unknown/invalid values. So,
   it should be possible to create an NMSetting instance without
   error or loosing information. But verify() should be usable to
   identify such settings as invalid.

They also have a few upsides.

 - libnm is heavily oriented around GObject. So, we generate
   our nm-settings manual based on the gtk-doc. Note however,
   how we fail to generate a useful manual for bond.options.
   Also note, that there is no reason we couldn't generate
   great documentation, even if the properties are not GObject
   properties.

 - GObject properties do give some functionality like meta-data,
   data binding and notification. However, the meta-data is not
   sufficient on its own. Note how keyfile and nmcli need extensive
   descriptor tables on top of GObject properties, to make this
   useful. Note how GObject notifications for NMSetting instances
   are usually not useful, aside for data binding like nmtui does.

Also note how NMSettingBond already follows a different paradigm
than using GObject properties. Nowdays, NMSettingBond is considered
a mistake (related bug rh#1032808). Many ideas of NMSettingBond
are flawed, like exposing an inferiour API that reduces everything
to a string hash. Also, it only implemented the options hash inside
NMSettingBond. That means, if we would consider this a good style,
we would have to duplicate this approach in each new setting
implementation.

Add a new style to track data for NMSetting subclasses. It keeps
an internal hash table with all GVariant properies. Also, the
functionality is hooked into NMSetting base class, so all future
subclasses that follow this way, can benefit from this. This approach
has a few similiarties with NMSettingBond, but avoids its flaws.

With this, we also no longer need GObject properties (if we would
also implement generating useful documentation based on non-gkt-doc).
They may be added as accessors if they are useful, but there is no
need for them.

Also, handling the properties as a hash of variants invites for a
more generic approach when handling them. While we still could add
accessors that operate on a one-by-one bases, this leads to a more
generic usage where we apply common functionality to a set of properties.

Also, this is for the moment entirely internal and an implementation
detail. It's entirely up to the NMSetting subclass to make use of this
new style. Also, there are little hooks for the subclass available.
If they turn out to be necessary, they might be added. However, for
the moment, the functionality is restricted to what is useful and
necessary.
2018-08-10 10:38:19 +02:00
clients libnm: use NMMetaSettingInfo for tracking setting priority 2018-08-10 10:38:19 +02:00
contrib checkpatch.pl: complain about space in elvis operator ?: 2018-08-09 17:07:23 +02:00
data all: add support for thunderbolt networking 2018-04-19 14:20:04 +02:00
dispatcher build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
docs libnm: introduce NMDeviceWireGuard 2018-08-06 08:34:27 +02:00
examples all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
introspection core: introduce NMDeviceWireGuard 2018-08-06 08:34:27 +02:00
libnm all: add connection.multi-connect property for wildcard profiles 2018-08-08 11:24:29 +02:00
libnm-core libnm: add generic-data for implementing NMSetting 2018-08-10 10:38:19 +02:00
libnm-glib build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
libnm-util libnm/trivial: cleanup variable names in settings' class-init functions 2018-08-10 10:38:19 +02:00
m4 build: set -Wall when probing extra warning options 2018-08-07 16:58:36 +02:00
man man/openvswitch: advise to use "master" instead of "conn.master" 2018-08-06 18:59:01 +02:00
po po: update Ukrainian (uk) translation (bgo#796728) 2018-07-12 07:37:25 +02:00
shared shared: use binary search in nm_meta_setting_infos_by_name() 2018-08-10 10:38:19 +02:00
src shared: move nm_utils_array_find_binary_search() to shared utils 2018-08-10 10:38:19 +02:00
tools tests/trivial: rename ip4_addr_ne32() to ip4_addr_be32() in test-networkmanager-service.py 2018-07-11 17:53:44 +02:00
vapi meson: Use string variables extensively 2018-01-10 12:22:55 +01:00
.dir-locals.el misc: add toplevel .dir-locals file that tells Emacs to show trailing whitespace 2013-03-08 15:15:28 +01:00
.gitignore build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
.mailmap mailmap: minor adjustment to mailmap not to match by name 2018-06-29 11:10:35 +02:00
.travis.yml travis: do out-of-tree build in travis 2018-07-17 17:46:39 +02:00
AUTHORS misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
autogen.sh build: disable libnm-glib by default 2018-06-15 13:07:53 +02:00
ChangeLog Changelog: remove and replace the changelog by a stub 2017-02-14 17:39:46 +01:00
config-extra.h.meson build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
config.h.meson auth-manager: always compile D-Bus calls to polkit 2018-04-13 09:09:46 +02:00
configure.ac build: avoid AC_CHECK_FILE() due to problems with cross-compilation 2018-07-26 08:51:45 +02:00
CONTRIBUTING Make licensing of contributions more explicit 2017-07-25 07:16:35 +02:00
COPYING docs: create new master NM documentation module 2011-02-16 16:24:16 -06:00
linker-script-binary.ver iface-helper/build: add linker version script 2016-10-13 21:33:33 +02:00
linker-script-devices.ver devices/build: use one linker-script-devices.ver for all device plugins 2016-10-13 21:36:06 +02:00
linker-script-settings.ver settings/build: add linker version script for settings plugins 2016-10-13 21:33:33 +02:00
MAINTAINERS misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
Makefile.am libnm: introduce NMDeviceWireGuard 2018-08-06 08:34:27 +02:00
Makefile.examples examples/python: drop nmex.py 2018-06-29 20:05:39 +02:00
Makefile.glib build: include "config.h" in nm*enum-types.c sources 2015-10-05 15:01:38 +02:00
Makefile.vapigen build: fix make always re-making vapigen target 2016-10-21 18:46:03 +02:00
meson.build release: bump version to 1.13.2 (development) 2018-07-25 12:39:06 +02:00
meson_options.txt logging: warn about invalid logging backends and drop "debug" backend 2018-06-27 09:21:33 +02:00
meson_post_install.py build: add initial support for meson build system 2017-12-13 15:48:50 +01:00
NetworkManager.pc.in build: update NetworkManager.pc 2013-01-29 16:17:30 -05:00
NEWS core: implement connection.multi-connect to activate profiles multiple times 2018-08-08 11:24:29 +02:00
README all: replace "it's" with "its" where needed 2018-04-18 14:14:07 +02:00
TODO all: replace "it's" with "its" where needed 2018-04-18 14:14:07 +02:00
valgrind.suppressions valgrind: update glib2 suppression for Fedora 27 2017-11-15 17:05:01 +01:00
zanata.xml po: add Zanata configuration 2016-04-05 14:35:53 +02:00

******************
2008-12-11: NetworkManager core daemon has moved to git.freedesktop.org!

git clone git://git.freedesktop.org/git/NetworkManager/NetworkManager.git
******************


Networking that Just Works
--------------------------

NetworkManager attempts to keep an active network connection available at all
times.  The point of NetworkManager is to make networking configuration and
setup as painless and automatic as possible.  NetworkManager is intended to
replace default route, replace other routes, set IP addresses, and in general
configure networking as NM sees fit (with the possibility of manual override as
necessary).  In effect, the goal of NetworkManager is to make networking Just
Work with a minimum of user hassle, but still allow customization and a high
level of manual network control.  If you have special needs, we'd like to hear
about them, but understand that NetworkManager is not intended for every
use-case.

NetworkManager will attempt to keep every network device in the system up and
active, as long as the device is available for use (has a cable plugged in,
the killswitch isn't turned on, etc).  Network connections can be set to
'autoconnect', meaning that NetworkManager will make that connection active
whenever it and the hardware is available.

"Settings services" store lists of user- or administrator-defined "connections",
which contain all the settings and parameters required to connect to a specific
network.  NetworkManager will _never_ activate a connection that is not in this
list, or that the user has not directed NetworkManager to connect to.


How it works:

The NetworkManager daemon runs as a privileged service (since it must access
and control hardware), but provides a D-Bus interface on the system bus to
allow for fine-grained control of networking.  NetworkManager does not store
connections or settings, it is only the mechanism by which those connections
are selected and activated.

To store pre-defined network connections, two separate services, the "system
settings service" and the "user settings service" store connection information
and provide these to NetworkManager, also via D-Bus.  Each settings service
can determine how and where it persistently stores the connection information;
for example, the GNOME applet stores its configuration in GConf, and the system
settings service stores its config in distro-specific formats, or in a distro-
agnostic format, depending on user/administrator preference.

A variety of other system services are used by NetworkManager to provide
network functionality: wpa_supplicant for wireless connections and 802.1x
wired connections, pppd for PPP and mobile broadband connections, DHCP clients
for dynamic IP addressing, dnsmasq for proxy nameserver and DHCP server
functionality for internet connection sharing, and avahi-autoipd for IPv4
link-local addresses.  Most communication with these daemons occurs, again,
via D-Bus.


Why doesn't my network Just Work?

Driver problems are the #1 cause of why NetworkManager sometimes fails to
connect to wireless networks.  Often, the driver simply doesn't behave in a
consistent manner, or is just plain buggy.  NetworkManager supports _only_
those drivers that are shipped with the upstream Linux kernel, because only
those drivers can be easily fixed and debugged.  ndiswrapper, vendor binary
drivers, or other out-of-tree drivers may or may not work well with
NetworkManager, precisely because they have not been vetted and improved by the
open-source community, and because problems in these drivers usually cannot
be fixed.

Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will
fail.  This is again often due to buggy drivers, because these drivers simply
aren't expecting the dynamic requests that NetworkManager and wpa_supplicant
make.  Driver bugs should be filed in the bug tracker of the distribution being
run, since often distributions customize their kernel and drivers.

Sometimes, it really is NetworkManager's fault.  If you think that's the case,
please file a bug at http://bugzilla.gnome.org and choose the NetworkManager
component.  Attaching the output of /var/log/messages or /var/log/daemon.log
(wherever your distribution directs syslog's 'daemon' facility output) is often
very helpful, and (if you can get) a working wpa_supplicant config file helps
enormously.