mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 19:00:31 +01:00
The default value of a string property (almost?) always should be %NULL, which means the value is absent and not specified. That is necessary because adding new properties must be backward compatible. That means, after upgrade those properties will have their value unset. In these cases, %NULL really translates to some property dependant behavior (like not using the value, or using a special default value). For example leaving "ethernet.cloned-mac-address" unset really means "preserve", with the twist that %NULL can be overridden by a global connection default. For most string properties, a value can only be unset (%NULL) or set to a non-empty string. nm_connection_verify() enforces that. However, for some properties, it makes sense to allow both unset and the empty word "" as value. This is the case if a property can have it's value overridden by a global connection default, or if we need the differentiation between having a value unset and having it set to the empty word. We would usually avoid allowing the empty word beside %NULL, because that makes it hard to express the difference on the command line of nmcli or in a UI text entry field. In the "ethernet.cloned-mac-address" example, "" is not necessary nor sensible. However, for some properties really all string values may be possible (including "") and also unset/%NULL. Then, we need some form of escaping/mangling, to allow to express all possible values. The chosen style here is that on nmcli input field "" means %NULL, while a word with all white space stands for the word with one less white space characters. This is still unused, but I think it makes sense for some properties. I initially added this for "connection.mud-url", but a valid MUD-URL always must start with "https://", so not all strings are possible to begin with. So to explicitly express that no MUD-URL should be set, we will instead introduce a special word "none", and not use the empty word, due to the oddities discussed here. However, I think this may well make sense for some properties where all strings are valid. |
||
|---|---|---|
| .. | ||
| tests | ||
| meson.build | ||
| nm-client-utils.c | ||
| nm-client-utils.h | ||
| nm-meta-setting-access.c | ||
| nm-meta-setting-access.h | ||
| nm-meta-setting-desc.c | ||
| nm-meta-setting-desc.h | ||
| nm-polkit-listener.c | ||
| nm-polkit-listener.h | ||
| nm-secret-agent-simple.c | ||
| nm-secret-agent-simple.h | ||
| nm-vpn-helpers.c | ||
| nm-vpn-helpers.h | ||
| qrcodegen.c | ||
| qrcodegen.h | ||
| settings-docs.h.in | ||
| settings-docs.xsl | ||