summaryrefslogtreecommitdiff
path: root/src/nm-config.c
Commit message (Collapse)AuthorAgeFilesLines
* config: minor fix in read_entire_config()Thomas Haller2015-05-191-2/+1
| | | | | | | Calling read_entire_config() without passing a @cli argument would always have caused an assert due to unset @o_config_main_file. That is not a real problem as that situation didn't arise. Still fix it.
* config: make ignore-carrier option reloadableThomas Haller2015-05-051-14/+0
| | | | | | | | Only move the ignore-carrier option from NMConfig to NMConfigData. The ignore-carrier option is still immutable after startup. https://bugzilla.gnome.org/show_bug.cgi?id=748050
* dns: allow runtime selection of resolv.conf managerBeniamino Galvani2015-05-041-0/+2
| | | | | | | | | | | Add a new 'rc-manager' configuration parameter that allows to select the strategy used to write resolv.conf; currently supported values are: none|resolvconf|netconfig, 'none' meaning that NM directly writes the file. The default value of the parameter is 'none'; however if a RESOLVCONF_PATH (or NETCONFIG_PATH) is specified at build time, the default value will be 'resolvconf' (or 'netconfig').
* config: fix filename order for config-descriptionThomas Haller2015-04-171-9/+16
| | | | | | | | The configuration snippets are loaded in alphabetical order. Fix the printed description to reflect that order. Otherwise, NM logs at startup: <info> Read config: /etc/NetworkManager/NetworkManager.conf and conf.d: 20-connectivity-fedora.conf, 10-ibft-plugin.conf
* config: move dns mode configuration to NMConfigDataLubomir Rintel2015-02-251-11/+2
| | | | | This will make is possible for the NMDnsManager to watch for configuration changes.
* core: unify parsing of device specs using nm_match_spec_split()Thomas Haller2015-02-241-21/+26
| | | | | | | | | | | | There are three configuration options that contain device specs: 'main.ignore-carrier', 'main.no-auto-default', and 'keyfile.unmanaged-devices'. Unify the parsing of them by splitting the device spec with nm_match_spec_split(). This changes behavior for parsing of these properties. Also get rid of logging warnings when parsing 'keyfile.unmanaged-devices'.
* config: add configure and quit command line optionLubomir Rintel2015-02-161-0/+7
| | | | | | | Useful for using the feature without having to hardcode it in configuration (container set up scripts, development). https://bugzilla.gnome.org/show_bug.cgi?id=744241
* config: fix memleak in read_config()Thomas Haller2015-02-091-2/+4
|
* config: use flags argument in config-changed signal instead of a hash tableth/rh1066697_reload_configThomas Haller2015-02-031-21/+43
|
* config: make NMConfig implement GInitableThomas Haller2015-02-031-17/+36
|
* config: move no-auto-default to NMConfigDataThomas Haller2015-02-031-31/+42
| | | | | | | | With this change, NMConfig is really immutable and all modifyable parts migrated to NMConfigData. Another advantage is that components can now subscribe to NMConfig changes to pickup changes to no-auto-default.
* config: refactor merging no_auto_defaultThomas Haller2015-02-031-16/+13
|
* config: move keyfile values to NMConfigDataThomas Haller2015-02-031-27/+14
|
* config: add new function nm_config_data_diff()Thomas Haller2015-02-031-20/+2
|
* config: move main_file and description to NMConfigDataThomas Haller2015-02-031-26/+31
| | | | | Every reload might change the main_file and description. Move those properties to NMConfigData.
* config: refactor reloading not to create a second NMConfig instanceThomas Haller2015-02-031-32/+28
|
* config: minor refactoring to highlight mutable property no_auto_default of ↵Thomas Haller2015-02-031-3/+9
| | | | NMConfig
* config: refactor read_entire_config() to merge command line optionsThomas Haller2015-02-031-27/+34
|
* config: refactor to inject NMConfigCmdLineOptions to NMConfig constructorThomas Haller2015-02-031-7/+39
|
* config: refactor nm_config_new() by extracting function read_entire_config()Thomas Haller2015-02-031-20/+70
|
* config: refactor nm_config_new() by extracting function _get_config_dir_files()Thomas Haller2015-02-031-38/+54
|
* config/trivial: rename variables for configuration fileThomas Haller2015-02-031-20/+20
| | | | | The name "nm_conf_path" and cli.config_path" were not consistent. Rename them both to "config_main_file".
* config: refactor read_config() to make it independent from NMConfigThomas Haller2015-02-031-23/+30
|
* config: implement reloading of connectivity parametersThomas Haller2015-02-031-1/+6
|
* config: add support for reloading of configurationThomas Haller2015-02-031-0/+70
| | | | | | | | | | No actual reloading is yet implemented. Later we will decide on specific configuration parameters where we support reloading. They must be then implemented one-by-one. Some configuration parameters can be set via command line. If a parameter is set from command line, the original value from command line will still be preserved after reloading.
* config: use NMConfigData in NMConfigThomas Haller2015-02-031-33/+39
|
* config: add nm_config_setup() to initialize config singletonThomas Haller2015-02-031-71/+136
| | | | | | | | | Make nm_config_new() usable without accessing static/singleton data. nm_config_setup() is now used to initialize the singleton. Still, you must not call nm_config_get() before calling nm_config_setup() or after freeing the provided singleton instance.
* config/trivial: fix returning FALSE instead of NULL in nm_config_new()Thomas Haller2015-02-031-1/+1
|
* config: fix memory leak in merge_no_auto_default_state()Thomas Haller2015-02-031-6/+10
|
* config: fix memleak in read_config()Thomas Haller2015-01-291-1/+6
|
* all: consistently include config.hDan Winship2014-11-131-1/+2
| | | | | | | | | | | 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.)
* iface-helper: add nm-iface-helper for dynamic configure-then-quit supportDan Williams2014-11-071-50/+30
| | | | | | | | | | | | When quitting, the Manager asks each device to spawn the interface helper, which persists and manages dynamic address on the interface after NetworkManager is gone. If the dynamic address cannot be maintaned, the helper quits and the interface's address may be removed when their lifetime runs out. To keep the helper as simple as possible, NetworkManager passes most of the configuration on the command-line, including some properties of the device's current state, which are necessary for the helper to maintain DHCP leases or IPv6 SLAAC addresses.
* core: add option to quit when startup is complete (rh #863515) (rh #1083683)Dan Williams2014-11-071-0/+10
| | | | | | | | | | Cloud setups often have a never-changing setup and since every cycle counts, they don't really want a management process running in the background after network setup is complete. Since it's likely a VM, it's not like links are going to go up/down very often. Add a new "configure-quit=true/false" config option which, when set to true, will quit NetworkManager after startup and initial configuration is complete.
* config: set a compile time default for the main.plugins configuration optionThomas Haller2014-10-291-0/+2
| | | | | | | | | In case of a missing NetworkManager.conf (or a missing configuration option main.plugins), allow to determine the fallback at compile time https://bugzilla.gnome.org/show_bug.cgi?id=738611 Signed-off-by: Thomas Haller <thaller@redhat.com>
* auth: rework polkit autorization to use DBUS interface directlyThomas Haller2014-09-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | This makes NetworkManager independent of <polkit/polkit.h> development headers and libpolkit-gobject-1.so library. Instead communicate directly with polkit using its DBUS interface. PolicyKit support is now always compiled in. You can control polkit authorization with the configuration option [main] auth-polkit=yes|no If the configure option is omitted, a build time default value is used. This default value can be set with the configure option --enable-polkit. This commit adds a new class NMAuthManager that reimplements the relevant DBUS client parts. It takes source code from the polkit library. https://bugzilla.gnome.org/show_bug.cgi?id=734146 Signed-off-by: Thomas Haller <thaller@redhat.com>
* config: refactor parsing of boolean config valuesThomas Haller2014-09-291-9/+43
| | | | | | | Allow for the special values "1" and "0". Also, ignore the letter case when comparing the configuration value. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: update data types of some hwaddr propertiesDan Winship2014-08-071-7/+2
| | | | | | | | | | | | | | Now that we have nm_utils_hwaddr_matches() for comparing addresses (even when one is a string and the other binary), there are now places where it's more convenient to store hardware addresses as strings rather than binary, since we want them in string form for most non-comparison purposes. So update for that. In particular, this also changes nm_device_get_hw_address() to return a string. Also, simplify the update_permanent_hw_address() implementations by assuming that they will only be called once. (Since they will.)
* libnm-core, etc: drop type-based hwaddr funcs, port to length-based onesDan Winship2014-08-071-1/+1
| | | | | | | | | | Drop the arptype-based nm_utils_hwaddr funcs, and rename the length-based ones to no longer have _len in their names. This also switches nm_utils_hwaddr_atoba() to using a length rather than an arptype, and adds a length argument to nm_utils_hwaddr_valid() (making nm_utils_hwaddr_valid() now a replacement for nm_utils_hwaddr_aton() in some places, where we were only using aton() to do validity checking).
* core: merge src/config, src/logging, src/posix-signals into src/Dan Winship2014-07-301-0/+632
| | | | | | | | | Some subdirectories of src/ encapsulate large chunks of functionality, but src/config/, src/logging/, and src/posix-signals/ are really only separated out because they used to be built into separate sub-libraries that were needed either for test programs, or to prevent circular dependencies. Since this is no longer relevant, simplify things by moving their files back into the main source directory.
* config: move NMConfig into its own subdirectory/libraryDan Winship2013-04-031-357/+0
| | | | | Also, remove the unused NMConfigError, and add a config-parsing test program.
* trivial: remove extra semicolonsJiří Klimeš2013-03-121-2/+2
|
* config: rename fill_from_file() to read_config()Dan Williams2013-03-111-6/+5
|
* config: fix bounds of connectivity_interval valuesDan Williams2013-03-111-3/+7
| | | | | | | | | | 0 means "turn off connectivity checking", so we can't use that to determine whether or not the interval has already been set by command-line options or not. Instead, store the interval internally as a signed int and use -1 to mean "not yet set". Second, validate input values for interval to ensure they can't be less than 0 or more than G_MAXINT.
* config: honor CLI arguments when config file is not foundJonh Wendell2013-03-111-37/+33
| | | | | If no config file was present, the Config object is returned empty even if some options were passed via the command-line.
* trivial: move NMConfig GObject functions to the bottomDan Williams2013-03-111-73/+76
| | | | | More closely match the style of other objects in NM, where the actual logic is nearer the top, and GObject stuff is near the bottom.
* config: convert NMConfig to objectThomas Bechtold2013-03-111-59/+126
|
* all: remove pointless NULL checksDan Winship2013-02-131-6/+0
| | | | | | | | | | | g_malloc(), etc, never return NULL, by API contract. Likewise, by extension, no other glib function ever returns NULL due to lack of memory. So remove lots of unnecessary checks (the vast majority of which would have immediately crashed had they ever run anyway, since g_set_error(), g_warning(), and nm_log_*() all need to allocate memory). https://bugzilla.gnome.org/show_bug.cgi?id=693678
* build: unify NetworkManager path handling (some paths are changed)Pavel Šimerda2012-11-051-2/+2
| | | | | | | | | | | | | | | | | | | Use autoconf/automake variables for NetworkManager paths. Use NetworkManager subdirectory where appropriate. Files in /var/run (or /run on some distros) are moved into a separate directory as is usual with other daemons. It makes the filesystem more readable and file prefixing unnecessary. /var/run/NetworkManager.pid -> /var/run/NetworkManager/NetworkManager.pid /var/run/nm-dns-dnsmasq.pid -> /var/run/NetworkManager/dnsmasq.pid /var/run/nm-dns-dnsmasq.conf -> /var/run/NetworkManager/dnsmasq.conf The /var/run/NetworkManager directory is created at runtime, if it doesn't exist. Note: Path-based security policies like SELinux and AppArmor may need to be adapted.
* config: fix return value in g_return_val_if_fail() - it's unsignedJiří Klimeš2012-07-091-1/+1
|
* core: add internet connectivity checkThomas Bechtold2012-02-271-4/+61
| | | | | | | | * use libsoup to compare a http response from a given uri with a given response (use g_str_has_prefix () to compare) * do periodically check the connectivity. Check interval is configurable * check connectivity when device state change from/to NM_DEVICE_STATE_ACTIVATED