Commit Graph

22710 Commits

Author SHA1 Message Date
Thomas Haller
2a50729c6f cli: add clear-all-fcn for objlist properties 2019-03-25 09:12:33 +01:00
Thomas Haller
ad15b2505b cli: add objlist property type and implement get_fcn() for all types 2019-03-25 09:12:33 +01:00
Thomas Haller
126348d4be cli: implement team:runner-tx-hash as multilist property 2019-03-25 09:12:33 +01:00
Thomas Haller
1b1ef52ff8 cli: implement match:interface-names as multilist property 2019-03-25 09:12:33 +01:00
Thomas Haller
e3fa570c1b shared: add "strip" argument to _nm_utils_unescape_spaces()
It's usually not necessary, because _nm_utils_unescape_spaces()
gets called after nm_utils_strsplit_set(), which already removes
the non-escaped spaces.

Still, for completeness, this should be here. Also, because with
this the function is useful for individual options (not delimiter
separate list values), to support automatically dropping leading or
trailing whitespace, but also support escaping them.
2019-03-25 09:12:33 +01:00
Thomas Haller
b91f21aa23 cli: implement connection:permissions as multilist property 2019-03-25 09:12:32 +01:00
Thomas Haller
ecd0e34fe9 cli: minor cleanup of _get_fcn_connection_permissions() 2019-03-25 09:12:32 +01:00
Thomas Haller
cb310a061b cli: implement connection:secondaries as multilist property 2019-03-25 09:12:32 +01:00
Thomas Haller
b9cd9c8dc8 cli: implement mac-address-blacklist properties as mulitlist types 2019-03-25 09:12:32 +01:00
Thomas Haller
0cb1c20f93 cli: first validate all values in _set_fcn_multilist() before modifying the setting 2019-03-25 09:12:32 +01:00
Thomas Haller
b63620e67c cli: implement DNS property as multilist type 2019-03-25 09:12:32 +01:00
Thomas Haller
d9c8794338 cli: support validating multilist entries for remove-by-value 2019-03-25 09:12:32 +01:00
Thomas Haller
0bf55f097e cli: implement DNS option property as multilist type 2019-03-25 09:12:32 +01:00
Thomas Haller
3d1206e878 cli: make get_with_default property-type-data generally available
A property-info can only have one property-typ-data. That means,
all functions (get_fcn(), set_fcn()) need to either take not
property-typ-data, or they must all accept the same.

That made it hard to mix _get_fcn_nmc_with_default() with setters
that do require a certain property-typ-data. Instead, move the
is_default_func() to the general portion, and let _get_fcn_gobject()
handle it.
2019-03-25 09:12:32 +01:00
Thomas Haller
180925ff0c cli: implement DNS search property as multilist type 2019-03-25 09:12:32 +01:00
Thomas Haller
89cc1d1822 cli: add property type for 802-1x certificate properties (pt5) 2019-03-25 09:12:32 +01:00
Thomas Haller
8aa19e3f2c cli: add property type for 802-1x certificate properties (pt4) 2019-03-25 09:12:32 +01:00
Thomas Haller
fe390556ab cli: add property type for 802-1x certificate properties (pt3) 2019-03-25 09:12:32 +01:00
Thomas Haller
99711579ed cli: add property type for 802-1x certificate properties (pt2) 2019-03-25 09:12:32 +01:00
Thomas Haller
df0d5f8dee cli: add property type for 802-1x certificate properties (pt1) 2019-03-25 09:12:32 +01:00
Thomas Haller
b83c88783e shared: add set function to nm_setting_8021x_scheme_vtable 2019-03-25 09:12:32 +01:00
Thomas Haller
cc2971a3d3 cli: merge mac_address_blacklist setters 2019-03-25 09:12:32 +01:00
Thomas Haller
c91e201689 cli: implement NM_SETTING_WIRED_S390_OPTIONS with the optionlist setter 2019-03-25 09:12:32 +01:00
Thomas Haller
592085025c libnm: don't assert for valid string length in nm_setting_wired_add_s390_option()
The setting's verify() function already checks that the s390 options
are not empty and no longer than 200. Asserting for that is a major
annoyance, because callers need to reimplement that check.
2019-03-25 09:12:32 +01:00
Thomas Haller
0700815d63 cli: implement NM_SETTING_VPN_SECRETS with the optionlist setter 2019-03-25 09:12:32 +01:00
Thomas Haller
e58ec47d1b cli: implement NM_SETTING_VPN_DATA with the optionlist setter 2019-03-25 09:12:32 +01:00
Thomas Haller
bcee2d7cc9 cli: add optionlist setter for bond options 2019-03-25 09:12:32 +01:00
Thomas Haller
1b0ee63a18 cli: remove DEFINE_REMOVER_OPTION() macro
Instead of having a trivial macro that defines a function, define the
function directly.

Having such a macro would make sense if DEFINE_REMOVER_OPTION() would do
the right thing and we would reuse the (preferred) implementation.
That's not the case, because these remove_fcn() implementations don't
mirror the way how set_fcn() splits and sets options. They are
inconsistent (wrong), and should will later get merged with set_fcn().
2019-03-25 09:12:32 +01:00
Thomas Haller
8e7b23e11a cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt8) 2019-03-25 09:12:32 +01:00
Thomas Haller
0f3252e0da cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt7) 2019-03-25 09:12:32 +01:00
Thomas Haller
cecf110f63 cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt6) 2019-03-25 09:12:32 +01:00
Thomas Haller
9c83bf5593 cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt5) 2019-03-25 09:12:32 +01:00
Thomas Haller
46eb783fcd cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt4) 2019-03-25 09:12:32 +01:00
Thomas Haller
574f1cf1a4 cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt3) 2019-03-25 09:12:32 +01:00
Thomas Haller
9876c334f4 cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt2) 2019-03-25 09:12:32 +01:00
Thomas Haller
4f0a629c1e cli: merge IPv4 and IPv6 implementation for NMSettingIPConfig (pt1) 2019-03-25 09:12:32 +01:00
Thomas Haller
c4be9db005 shared: move nm_setting_ip_config_get_addr_family() to "shared/nm-libnm-core-utils.h" 2019-03-25 09:12:32 +01:00
Thomas Haller
05080816f0 cli/dcb: merge DCB uint setters 2019-03-25 09:12:32 +01:00
Thomas Haller
1fa1b01546 cli/dcb: rework DCB uint getters 2019-03-25 09:12:32 +01:00
Thomas Haller
ca38ce95ee cli/dcb: merge handling NM_SETTING_DCB_PRIORITY_FLOW_CONTROL and NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH 2019-03-25 09:12:32 +01:00
Thomas Haller
fa4ed3ac0d cli/dcb: merge getter for dcb flags 2019-03-25 09:12:32 +01:00
Thomas Haller
d1016cfade cli/trivial: drop unused macro 2019-03-25 09:12:32 +01:00
Thomas Haller
da4648d48f cli: implement DEFINE_SETTER_STR_LIST() as _pt_multilist type 2019-03-25 09:12:32 +01:00
Thomas Haller
74f922b64f cli: implement str-list-multi properties as property type and not via macros
Instead of using a macro to define the individual set/remove functions,
add a new property type _pt_multilist.

This way, we have more the concept of a property having a type, instead
of a property having a set of handlers how to implement something.

Also, this is only the first step. There are several similar properties
that also can be implemented as the same type.
2019-03-25 09:12:32 +01:00
Thomas Haller
03502cf5bf cli/trivial: add code comment about nmc_value_transforms_register() 2019-03-25 09:12:32 +01:00
Thomas Haller
3c82db710f cli: reset default value of properties via set_fcn()
The property implementation must itself decide how to reset a value.
We must not rely on properties being plain GObject properties.

Let set_fcn() accept %NULL value to indicate resetting the default.
2019-03-25 09:12:32 +01:00
Thomas Haller
20afdeb19a cli: let DEFINE_REMOVER_INDEX_OR_VALUE_DIRECT handle static value list
Previously we had DEFINE_REMOVER_INDEX_OR_VALUE_DIRECT() and
DEFINE_REMOVER_INDEX_OR_VALUE_VALIDATING_STATIC().

Note that all property-infos of DEFINE_REMOVER_INDEX_OR_VALUE_VALIDATING_STATIC()
would also define values_static list, while DEFINE_REMOVER_INDEX_OR_VALUE_DIRECT()
would not.

Merge the two macros. The property-info should define how the
implementation behaves, we should not have two implementations.
2019-03-25 09:12:32 +01:00
Thomas Haller
f933fb3cfb cli: validate remove_fcn() for NM_SETTING_802_1X_EAP against allowed values
set_fcn() of NM_SETTING_802_1X_EAP is implemented via
DEFINE_SETTER_STR_LIST_MULTI() -- thus, considering valid values
from the static list.

The remove_fcn() should do that too, to be consistent.
2019-03-25 09:12:32 +01:00
Thomas Haller
18c22443f3 cli: reuse property info in DEFINE_REMOVER_INDEX_OR_VALUE_VALIDATING_STATIC()
The property-info already tracks the "values_static" list. No need to pass
it on redundantly.
2019-03-25 09:12:32 +01:00
Thomas Haller
10aa2fafab cli: directly define setter function via DEFINE_SETTER_STR_LIST_MULTI()
We don't need DEFINE_SETTER_STR_LIST_MULTI() to define a static function
that is called by the set_fcn() implementation. Instead, let the macro
define the actual set_fcn() function.
2019-03-25 09:12:32 +01:00