Commit Graph

16 Commits

Author SHA1 Message Date
Beniamino Galvani
9b9dce9486 all: add 'match' setting
Add a new 'match' setting containing properties to match a connection
to devices. At the moment only the interface-name property is present
and, contrary to connection.interface-name, it allows the use of
wildcards.
2018-08-11 09:41:07 +02:00
Thomas Haller
df30651b89 libnm, cli, ifcfg-rh: add NMSettingEthtool setting
Note that in NetworkManager API (D-Bus, libnm, and nmcli),
the features are called "feature-xyz". The "feature-" prefix
is used, because NMSettingEthtool possibly will gain support
for options that are not only -K|--offload|--features, for
example -C|--coalesce.

The "xzy" suffix is either how ethtool utility calls the feature
("tso", "rx"). Or, if ethtool utility specifies no alias for that
feature, it's the name from kernel's ETH_SS_FEATURES ("tx-tcp6-segmentation").
If possible, we prefer ethtool utility's naming.

Also note, how the features "feature-sg", "feature-tso", and
"feature-tx" actually refer to multiple underlying kernel features
at once. This too follows what ethtool utility does.

The functionality is not yet implemented server-side.
2018-08-10 10:38:19 +02:00
Thomas Haller
f77f74f273 shared: use binary search in nm_meta_setting_infos_by_name()
nm_meta_setting_infos_by_name() did a naive search by name by
iterating over all 42 setting types.

Reorder nm_meta_setting_infos array, and use binary search instead.
2018-08-10 10:38:19 +02:00
Thomas Haller
9c47e2ce30 libnm: use NMMetaSettingInfo for tracking setting priority
Previously, each (non abstract) NMSetting class had to register
its name and priority via _nm_register_setting().

Note, that libnm-core.la already links against "nm-meta-setting.c",
which also redundantly keeps track of the settings name and gtype
as well.

Re-use NMMetaSettingInfo also in libnm-core.la, to track this meta
data.

The goal is to get rid of private data structures that track
meta data about NMSetting classes. In this case, "registered_settings"
hash. Instead, we should have one place where all this meta data
is tracked. This was, it is also accessible as internal API,
which can be useful (for keyfile).

Note that NMSettingClass has some overlap with NMMetaSettingInfo.
One difference is, that NMMetaSettingInfo is const, while NMSettingClass
is only initialized during the class_init() method. Appart from that,
it's mostly a matter of taste, whether we attach meta data to
NMSettingClass, to NMMetaSettingInfo, or to a static-array indexed
by NMMetaSettingType.

Note, that previously, _nm_register_setting() was private API. That
means, no user could subclass a functioning NMSetting instance. The same
is still true: NMMetaSettingInfo is internal API and users cannot access
it to create their own NMSetting subclasses. But that is almost desired.
libnm is not designed, to be extensible via subclassing, nor is it
clear why that would be a useful thing to do. One day, we should remove
the NMSetting and NMSettingClass definitions from public headers. Their
only use is subclassing the types, which however does not work.

While libnm-core was linking already against nm-meta-setting.c,
nm_meta_setting_infos was unreferenced. So, this change increases
the binary size of libnm and NetworkManager (1032 bytes). Note however
that roughly the same information was previously allocated at runtime.
2018-08-10 10:38:19 +02:00
Beniamino Galvani
a2f12994b7 cli: add support for configuring SR-IOV 2018-07-11 16:16:22 +02:00
Lubomir Rintel
29636535b2 client: support 6lowpan setting 2018-06-26 16:21:55 +02:00
Lubomir Rintel
5da77c0e2c client: support wpan setting 2018-06-26 16:21:55 +02:00
Lubomir Rintel
92f8f30d47 clients: add tc qdisc support
What works:

  nmcli c add con-name dum0 ifname dum0 type dummy \
      tc.qdiscs 'ingress, root pfifo_fast'
  nmcli c modify dum0 -tc.qdiscs 'root pfifo_fast'
  nmcli c modify dum0 +tc.qdiscs 'root handle 666: fq_codel'
2017-12-11 10:52:23 +01:00
Lubomir Rintel
aec8d36b3e clients: add support for ovs-bridge setting 2017-10-30 17:40:09 +01:00
Lubomir Rintel
6f73b4608a clients: add support for ovs-port setting 2017-10-30 17:40:09 +01:00
Lubomir Rintel
6dcd54b0de clients: add support for ovs-interface setting 2017-10-30 17:40:09 +01:00
Lubomir Rintel
e7ab81098a clients: add support for ovs-patch setting 2017-10-30 17:40:09 +01:00
Thomas Haller
83a6f36207 cli: don't mark field names for translation
Before refactoring nmcli recently, field names were marked for translation.
Note that for the property names, marking them had no effect as only
plain strings can be marked with N_().

Note how --fields are also an input argument. The input should be
independent of the locale and not translated. Likewise, when printing
the header names, they should not be translated to match the --fields
option.

    $ LANG=de_DE.utf8 nmcli --fields GENERAL.DEVICE device show enp0s25
    GENERAL.GERÄT:                          enp0s25

Drop the translation marks.
2017-04-23 23:45:02 +02:00
Thomas Haller
6dfb3e9ffb cli/trivial: remove whitespace between N_ macro and parenthesis
For _() and N_() we don't have a space before the parenthesis.
Be consistent about that.
2017-04-19 18:27:19 +02:00
Thomas Haller
6c2727af14 cli: add meta data for NMSettingGeneric 2017-04-12 14:12:20 +02:00
Thomas Haller
b5c8622ad3 cli: split nm-meta-setting-desc out of settings
This part contains static functions and variables to describe
settings. It is distinct from the mechanism to use them, or
access them.

Split it out.

It still uses clients/cli/common.h and clients/cli/utils.h
which shall be fixed next.
2017-03-30 13:09:58 +02:00