summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting-ip4-config.c
Commit message (Collapse)AuthorAgeFilesLines
* all: goodbye libnm-glibLubomir Rintel2019-04-161-1853/+0
| | | | | | | | | | | | | | | | | | | | | | | This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
* Revert "all: goodbye libnm-glib"Lubomir Rintel2019-04-031-0/+1853
| | | | | | We need this for a little little longer :( This reverts commit 1de8383ad9fdfc8f552117e5d109bdfa7005634b.
* all: goodbye libnm-glibLubomir Rintel2019-03-191-1853/+0
| | | | | | | | | | | | | | | | | | | | | | | This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
* all: remove consecutive empty linesBeniamino Galvani2018-04-301-4/+0
| | | | | | | Normalize coding style by removing consecutive empty lines from C sources and headers. https://github.com/NetworkManager/NetworkManager/pull/108
* all: fix typos in documentation, translated strings and commentsYuri Chornoivan2017-05-281-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=783173
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* libnm-util: add ipv4.dhcp-timeout propertyLubomir Rintel2015-10-061-0/+39
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1262922
* all: drop includes to <glib/gi18n.h> for "nm-default.h"Dan Winship2015-08-051-1/+0
| | | | | | | The localization headers are now included via "nm-default.h". Also fixes several places, where we wrongly included <glib/gi18n-lib.h> instead of <glib/gi18n.h>. For example under "clients/" directory.
* all: make use of new header file "nm-default.h"Thomas Haller2015-08-051-1/+1
|
* all: rename nm-glib-compat.h to nm-glib.h, use everywhereDan Winship2015-07-241-2/+1
| | | | | | | | | | | | | | | | Rather than randomly including one or more of <glib.h>, <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to nm-glib.h, include <gio/gio.h> from there, and then change all .c files in NM to include "nm-glib.h" rather than including the glib headers directly. (Public headers files still have to include the real glib headers, since nm-glib.h isn't installed...) Also, remove glib includes from header files that are already including a base object header file (which must itself already include the glib headers).
* libnm-util: allow 0.0.0.0/1 route in verify() (rh #1203904)Jiří Klimeš2015-03-241-10/+0
| | | | | | | | | | | | | | OpenVPN uses a trick to override default route by adding these two routes: 0.0.0.0/1 and 128.0.0.0/1. We should allow this and only refuse real default route (i.e. prefix == 0). Also verify IPv6 addresses and routes. See: man openvpn (search for def1) https://community.openvpn.net/openvpn/wiki/IgnoreRedirectGateway https://bugzilla.redhat.com/show_bug.cgi?id=1203904
* libnm, libnm-util: move settings doc generation to libnm-coreDan Winship2014-11-191-123/+0
| | | | | | | | | | | | | | | | | | | | | Move the settings/plugins doc generation from libnm-util to libnm-core, since libnm-util isn't being updated for all new properties. With this commit, the keyfile and ifcfg-rh documentation is basically unchanged, except that deprecated properties are now gone, and new properties have been added, and the sections are in a different order. (generate-plugin-docs.pl just outputs the settings in Makefile order, and they were unsorted in libnm-util, but are sorted in libnm-core). The settings documentation used for nm-settings.5, the D-Bus API docs, and the nmcli help is changed a bit more at this point, and mostly for the worse, since the libnm-core setting properties don't match up with the D-Bus API as well as the libnm-util ones do. To be fixed... (I also removed the "plugins docs" line in each plugin docs comment block while moving them, since those blocks will be used for more than just plugins soon, and it's sort of obvious anyway.)
* libnm*: fix library gettext usageDan Winship2014-11-131-1/+1
| | | | | | | | | | | | | | | | | Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _() will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than "gettext (string)" (which will use the program's default domain, which works fine for programs in the NetworkManager tree, but not for external users). Likewise, we need to call bindtextdomain() so that gettext can find the translations if the library is installed in a different prefix from the program using it (and bind_textdomain_codeset(), so it will know the translations are in UTF-8 even if the locale isn't). (The fact that no one noticed this was broken before is because the libraries didn't really start returning useful translated strings much until 0.9.10, and none of the out-of-tree clients have been updated to actually show those strings to users yet.)
* all: consistently include config.hDan Winship2014-11-131-0/+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.)
* libnm: add NMSettingIPConfig:route-metricThomas Haller2014-11-071-0/+50
| | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=735512 https://bugzilla.redhat.com/show_bug.cgi?id=663730 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add ifcfg-rh specific description for propertiesjk/bgo683111-keyfile-ifcfg-rh-docsJiří Klimeš2014-08-291-0/+95
| | | | | as comments in libnm-util/nm-setting-*.c files The comments are parsed by generate-plugin-docs.pl script.
* libnm-util: add keyfile specific description for propertiesJiří Klimeš2014-08-291-0/+28
| | | | | as comments in libnm-util/nm-setting-*.c files The comments are parsed by generate-plugin-docs.pl script.
* libnm-util: remove NM_UTIL_PRIVATE_CALL, NMSettingIP4Config:address-labelsDan Winship2014-08-011-123/+7
| | | | | | Since libnm-util is no longer used from within NM, its copy of NM_UTIL_PRIVATE_CALL is now useless, and the internal-only NMSettingIP4Config:address-labels property is no longer needed.
* libnm-util, libnm-glib: whitespace fixesDan Winship2014-07-151-13/+22
| | | | Fix indentation, kill trailing whitespace, split some long lines.
* libnm-util, libnm-glib: standardize copyright/license headersDan Winship2014-07-151-5/+2
| | | | | | | | | | | | | | | | | | - 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: document "address-labels" property as for internal use onlyJiří Klimeš2014-06-261-0/+5
|
* libnm-util: remove NMSetting* GParamSpec docsDan Winship2014-06-191-142/+51
| | | | | | | | | | | | Remove all the GParamSpec docs, since everything now uses the gtk-doc docs instead, so there's no point in having two copies of each (which are often out of sync anyway). Since we're touching so many lines anyway, also fix up the indentation of the remaining property-installing lines, and add G_PARAM_STATIC_STRINGS to each paramspec (so the nick strings don't get strduped). Also, be consistent about starting a new line between "g_object_class_install_property" and its opening parenthesis.
* libnm-util: various NMSetting* property doc fixes/improvementsDan Winship2014-06-191-38/+39
| | | | | | | | | | Fix up various issues with the docs for the NMSetting properties, and pull in text from the GParamSpec docs where the GParamSpec docs were better (or contained information that is necessary in the context of nm-settings.5). Also, consistently wrap all of the doc comments to the same width (80 columns).
* libnm-util: fix gtk-doc bugs in NMSetting* propertiesDan Winship2014-06-191-7/+7
| | | | | | | | Fix misused gtk-doc annotations and incorrectly-identified properties. In particular, the upcoming introspection-based generate-settings-spec expands macro and enum values, so if you use '%' where you should have used '#', it will fail to find an expansion, and error out.
* libnm-utils: remove INFERRABLE flag from properties we don't actually inferDan Winship2014-06-041-2/+2
| | | | | | | | | | | | ipv4.never-default, ipv4.may-fail, and ipv6.privacy were marked INFERRABLE, but NMIP4Config / NMIP6Config didn't actually infer them, so they could cause connections to not match themselves after a restart. (Found while debugging https://bugzilla.redhat.com/show_bug.cgi?id=1086237, though this is not actually the problem there.) Related: rh#1086237
* all: fix various warnings detected with coverityThomas Haller2014-05-021-4/+0
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add (private API) support for address labels to NMSettingIP4ConfigDan Winship2014-03-261-7/+118
|
* libnm-util: more specific error for missing ipv[46].adddress when method=manualJiří Klimeš2014-03-031-4/+5
|
* libnm-util: add *_remove_*_by_value() functions for 'ipv4' and 'ipv6' settingsJiří Klimeš2014-02-281-1/+131
| | | | | | | | | | | | nm_setting_ip4_config_remove_dns_by_value() nm_setting_ip4_config_remove_dns_search_by_value() nm_setting_ip4_config_remove_address_by_value() nm_setting_ip4_config_remove_route_by_value() nm_setting_ip6_config_remove_dns_by_value() nm_setting_ip6_config_remove_dns_search_by_value() nm_setting_ip6_config_remove_address_by_value() nm_setting_ip6_config_remove_route_by_value()
* core: allow custom IP address ranges for Shared connections (bgo #675973)Dan Williams2014-01-231-8/+11
| | | | | | | | | | | | | | | | Given an IPv4 address and prefix for a shared config, figure out the DHCP address range automatically. To keep things simple we allow a max of 252 addresses (not including network address, broadcast address, and the hotspot) no matter what prefix you use, so if the address is 10.0.10.1, you still only get a range of 10.0.10.2 -> 10.0.10.254. But we also leave some addresses available above the host address for static stuff, like we did before. This is done on a sliding scale from 0 to 8 addresses, where about 1/10th the number of available addresses are reserved. https://bugzilla.gnome.org/show_bug.cgi?id=675973
* libnm-util: refactor NMSetting name and register_settingsThomas Haller2013-12-121-1/+0
| | | | | | | | | | | | | | | | - refactor register_settings to allow lookup by GType and add the settings name to SettingInfo. - setting NM_SETTING_NAME is deprecated and should not be set anymore. Indeed it has always be a bug, to reset the name to a different value. The only valid place to set the name was in the _init() function of the derived class itself. This is now no longer needed/possible. Instead the name get's detected based on the registered setting types. This makes use of the registered metadata that is available anyway since every usable setting has to register itself. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: don't touch dhcp-send-hostname when setting dhcp-hostname (rh ↵Jiří Klimeš2013-12-121-3/+0
| | | | | | | | | | | #1001529) It is better to leave it to user whether he wants to enable sending hostname, because he probably disabled it manually (dhcp-send-hostname is TRUE by default). Also, this would not work for plugins that read and set dhcp-hostname after dhcp-send-hostname. https://bugzilla.redhat.com/show_bug.cgi?id=1001529
* libnm-util: add INFERRABLE flag and remove CANDIDATEDan Williams2013-12-051-6/+6
| | | | | | INFERRABLE means the opposite of CANDIDATE; a property which NetworkManager can read ("infer") from the system or the kernel when generating connections. CANDIDATE isn't a great name and thus dies.
* libnm-util: remove usage of NM_SETTING_PARAM_SERIALIZEDan Williams2013-12-021-12/+12
| | | | | The only property that is not serializes is each settings' 'name' property, so the flag serves no purpose.
* trivial: whitespace fixThomas Haller2013-11-071-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* ifcfg-rh: reader: allow device to not have ipv4 setting.Jiri Pirko2013-08-221-27/+0
| | | | | | | | | | If BOOTPROTO is set to "none", user states that no ipv4 setting should be set. So respect that. Introduce helper is_any_ip4_address_defined() along the way to make the code more readable. Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* libnm-util: fix possible crash when IP method is NULLJiří Klimeš2013-07-031-1/+1
|
* libnm-util: verify() - can't set both IPv4 'disabled' and IPv6 'ignore' methodJiří Klimeš2013-06-251-0/+27
|
* libnm-util: prefix errors with 'setting.property' instead of 'property' onlyJiří Klimeš2013-06-131-12/+12
|
* libnm-util: deprecate nm_utils_slist_free(), use g_slist_free_full()Dan Winship2013-05-291-9/+9
|
* libnm-util: implement connection changed signalDan Williams2013-05-281-0/+12
| | | | | Emitted whenever settings are added or removed from the connection, and whenever any property of any setting in the connection is changed.
* libnm-util: fix memory leaks of dhcp_hostname and dhcp_client_idDan Williams2013-04-011-0/+2
|
* libnm-util: make property verification errors more descriptiveJiří Klimeš2013-03-131-29/+49
| | | | | | - fix g_set_error()/g_set_error_literal() usage - make the error messages translatable - use g_prefix_error() to prepend property name
* trivial: fix typos, wrong log domain in DHCPv4Stefan Brüns2012-11-201-4/+4
|
* libnm-util: clean up setting registrationDan Williams2012-10-291-2/+7
| | | | | | | | | | | | Make setting type registration less icky; instead of having the connection register all the settings, have the settings themselves register that information at library load time. Putting this sort of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard than the home-rolled stuff we had before. Also document the priority stuff so when adding new settings, people know what priority to use. (cleanups by jklimes)
* libnm-util: ensure address/route types are boxed on glib < 2.26Dan Williams2012-07-021-2/+3
|
* core: allow IPv4 to fail by defaultTore Anderson2012-03-151-1/+1
| | | | | | | | | | | | | | | (comments by dcbw) This allows out-of-the-box connectivity on IPv6-only networks. Once caveat is that connections where the user currently expects no IPv4 connectivity to terminate the connection and retry will no longer do so until IPv6 also times out, and if that network where IPv4 is expected to fail also has an IPv6 router sending advertisements, the connection will succeed instead of failing. That can be resolved by setting the right bit in the connection's config file; and it's expected that the number of users who expect IPv4 failure on a network with usable IPv6 connectivity is quite small compared to the benefit of OOB IPv6 connectivity.
* Use glib-mkenums to generate enum typesDan Winship2012-02-151-25/+0
| | | | | | | | | | | | | | | | | | | Rather than generating enum classes by hand (and complaining in each file that "this should really be standard"), use glib-mkenums. Unfortunately, we need a very new version of glib-mkenums in order to deal with NM's naming conventions and to fix a few other bugs, so just import that into the source tree temporarily. Also, to simplify the use of glib-mkenums, import Makefile.glib from https://bugzilla.gnome.org/654395. To avoid having to run glib-mkenums for every subdirectory of src/, add a new "generated" directory, and put the generated enums files there. Finally, use Makefile.glib for marshallers too, and generate separate ones for libnm-glib and NetworkManager.
* libnm-util: enforce IPv4 prefix range validityDan Williams2011-07-051-2/+5
| | | | | Prefixes are between 1 and 32 inclusive so we might as well enforce that.
* libnm-util: fix up another GObject introspection annotationDan Williams2011-07-051-1/+1
|