config: support a [connection] section to NetworkManager.conf to specify connection defaults

Add support for a new section [connection] in NetworkManager.conf.
If the connection leaves an option at "unknown"/"default", we can
support overwriting the value from global configuration.

We also support other sections that are named with "connection"
as a prefix, such as [connection2], [connection-wifi]. This is
to support multiple default values that can be applied depending
on the used device.

I think this has great potential. Only downside is that when
the user looks at a connection value, it will see that it is
unspecified. But the actually used value depends on the device
type and might not be obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=695383
https://bugzilla.redhat.com/show_bug.cgi?id=1164677
This commit is contained in:
Thomas Haller
2015-05-15 11:36:28 +02:00
parent f031b926c4
commit dc0193ac02
5 changed files with 272 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ const char *nm_config_data_get_rc_manager (const NMConfigData *self);
gboolean nm_config_data_get_ignore_carrier (const NMConfigData *self, NMDevice *device);
gboolean nm_config_data_get_assume_ipv6ll_only (const NMConfigData *self, NMDevice *device);
char *nm_config_data_get_connection_default (const NMConfigData *self,
const char *property,
NMDevice *device);
G_END_DECLS
#endif /* NM_CONFIG_DATA_H */