Commit Graph

214 Commits

Author SHA1 Message Date
Thomas Haller
84aa6bad89 cli: add property-info for NMSettingWired 2017-03-30 13:09:57 +02:00
Thomas Haller
486dc1e596 cli: add property-info for NMSettingWimax 2017-03-30 13:09:57 +02:00
Thomas Haller
d07acc753c cli: let string property-type handle checking values 2017-03-30 13:09:56 +02:00
Thomas Haller
9c6f70f9e0 cli: add property-info for NMSettingAdsl 2017-03-30 13:09:56 +02:00
Thomas Haller
f34ef5d1fe cli: add property-info for NMSettingPpp 2017-03-30 13:09:56 +02:00
Thomas Haller
6bf1d6fc16 cli: add property-info for NMSetting8021x 2017-03-30 13:09:56 +02:00
Thomas Haller
d530bffb6c cli: add property-info for NMSettingWirelessSecurity 2017-03-30 13:09:56 +02:00
Thomas Haller
09d127b473 cli: add property-info for NMSettingPppoe 2017-03-30 13:09:56 +02:00
Thomas Haller
a89e9a0a6f cli: add property-info for NMSettingDcb 2017-03-30 13:09:56 +02:00
Thomas Haller
89b5685695 cli: add property-info for NMSettingProxy 2017-03-30 13:09:56 +02:00
Thomas Haller
b9029a798e cli: add NmcPropertyType structure
We shall not only have a PropertyInfo. Most properties share common
behavior, that is, they have a type. Move the function pointers to
a NmcPropertyType structure, so that it can be reused for multiple
properties.

This promotes the idea that properties have a (limited) set of types
with some type specific behaviors. Contrary, to having each property
re-implement fully it's type. E.g. instead of having various property
re-define their full behavior as an "bool", have one property type
"bool" which can be attached to a property.
2017-03-30 13:09:56 +02:00
Thomas Haller
40f47dbb06 cli: add property-info for NMSettingIP4Config and NMSettingIP6Config 2017-03-30 13:09:56 +02:00
Thomas Haller
c023edc3bb cli: remove GLUE macros that hide names
It's useful to see the entire name not having a macro construct it.
Otherwise, the usage is not grepable.
2017-03-30 13:09:55 +02:00
Thomas Haller
f7937c8f4a cli: generate all-properties list from NmcSettingInfo
It's redundant information that requires us to declare it
in the static meta data. Generate it instead as needed.
2017-03-30 13:09:55 +02:00
Thomas Haller
cb66cf96d7 cli: add values_func() to NmcPropertyInfo and use for "connection" setting 2017-03-30 13:09:55 +02:00
Thomas Haller
10119aa3a3 cli: add remove_func() to NmcPropertyInfo and use for "connection" setting 2017-03-30 13:09:55 +02:00
Thomas Haller
850d652cdb cli: add remove_func() to NmcPropertyInfo and use for "connection" setting 2017-03-30 13:09:55 +02:00
Thomas Haller
2de82f11c9 cli: add set_func() to NmcPropertyInfo and use for "connection" setting 2017-03-30 13:09:55 +02:00
Thomas Haller
8b96cee124 cli: implement property getter for "connection" setting via nmc_setting_info 2017-03-30 13:09:55 +02:00
Thomas Haller
4e91492b76 cli: rework property handling via NmcPropertyInfo for NMSettingConnection
Add an improved way of tracking meta data about settings.

E.g. it is wrong to generate for each property a nmc_property_*_get_*()
function. Instead, there should be a meta data about the property
itself, and a mechanism to retrieve the property.

For now, only do this for NMSettingConnection and keep all the existing
infrastructure in place. Later on all settings shall be moved.

Especially to accomodate NmcOutputField mangles the concept of
setting-meta data, formatting options, and collecting output results.
It's a total hack, that will be need fixing later.
2017-03-30 13:09:55 +02:00
Thomas Haller
d3ad7920de cli: add setting-info structure to settings.c
Will get more use soon.
2017-03-30 13:09:55 +02:00
Thomas Haller
2b0c00a3e3 Revert "nmcli: output property values in "parsable" mode when the "--terse" option is specified"
This will be solved differently by th/setting-user-data-bgo776276
branch. Revert the change for now, the same functionality will be
restored later.

This reverts commit 623d888801.
2017-03-30 13:09:55 +02:00
Francesco Giudici
6520cf1171 nmcli: always print "--" for empty or unset values in normal/pretty output
This was already true for tabular ouput mode.
Align to this behavior when printing in multiline mode.
2017-03-28 10:55:00 +02:00
Francesco Giudici
39f1d44ec8 nmcli: output just the raw value of vlan.flags when in terse mode 2017-03-28 10:55:00 +02:00
Francesco Giudici
623d888801 nmcli: output property values in "parsable" mode when the "--terse" option is specified
Don't print value output in the "PRETTY" format when the --terse option
has been specified.
This should allow to feed back the output from "nmcli show" to "nmcli
modify" without changes.
2017-03-28 10:55:00 +02:00
Beniamino Galvani
d094914120 cli: support route options 2017-03-06 15:20:25 +01:00
Beniamino Galvani
4db7890fae cli: support dummy connections 2017-02-22 21:05:04 +01:00
Beniamino Galvani
9a215d332b cli: add support for 802-1x.auth-timeout property 2017-02-21 09:18:53 +01:00
Beniamino Galvani
bb72409e9f cli: support 802-1x.phase1-auth-flags 2017-02-20 14:06:14 +01:00
Beniamino Galvani
27a52989e3 cli: support the cdma.mtu property 2017-02-20 09:18:25 +01:00
Beniamino Galvani
c51232f940 cli: support the gsm.mtu property 2017-02-20 09:18:25 +01:00
Lubomir Rintel
4121e57c50 cli: add support for 802.1x certificate passwords 2017-02-17 14:24:34 +01:00
Lubomir Rintel
84c484ed5b cli: make match() return boolean
Coccinelle semantic patch:

  @@
  @@
  -int
  +gboolean
          matches (...);

  @@
  expression pattern, cmd, len;
  @@
  -int
  +gboolean
          matches (...)
          {
                  ...
  -               return memcmp (pattern, cmd, len);
  +               return memcmp (pattern, cmd, len) == 0;
          }

  @@
  expression prefix, str;
  @@
  (
  -matches (prefix, str) != 0
  +!matches (prefix, str)
  |
  -matches (prefix, str) == 0
  +matches (prefix, str)
  )

  @@
  expression prefix, str;
  @@
  -(matches (prefix, str))
  +matches (prefix, str)

  @@
  expression prefix, str;
  @@
  -(!matches (prefix, str))
  +!matches (prefix, str)

spatch --smpl-spacing --sp-file match.cocci --dir clients/cli/ \
  --include-headers --macro-file shared/nm-utils/gsystem-local-alloc.h
2017-02-15 13:04:07 +01:00
Beniamino Galvani
b2146a43e5 cli: fix setting of private key password
We can't pass the password obtained from
nm_setting_802_1x_get_*private_key_password() to
nm_setting_802_1x_set_*private_key() as the latter also frees the old
password.

Fixes: afd2811028
2017-02-13 15:50:21 +01:00
Jiří Klimeš
e29add5f81 cli: move code around to group related functions - no functional change
* all getter/setter/describe, ... functions grouped according to properties
* sort the settings groups alphabetically

(cherry picked from commit 418733f2c1)
2017-01-21 19:56:40 +01:00
Jiří Klimeš
1298a998a1 cli: simplify property functions for allowed values with a macro
DEFINE_ALLOWED_FOR_ENUMS

(cherry picked from commit 5f90f48467)
2017-01-21 19:56:35 +01:00
Jiří Klimeš
49702826b7 cli: TAB-completion for macsec.mode in interactive editor
(cherry picked from commit 6573c2d860)
2017-01-21 19:56:29 +01:00
Jiří Klimeš
344e48da75 cli: TAB-completion for ipv6.addr-gen-mode in interactive editor
(cherry picked from commit 4d8800c876)
2017-01-21 19:56:23 +01:00
Jiří Klimeš
6397ce1fac cli: enable TAB-completion for proxy properties in interactive editor 2017-01-17 14:27:31 +01:00
Beniamino Galvani
d197c0626a cli: macsec support 2017-01-16 17:47:10 +01:00
Lubomir Rintel
b4a31174ea cli: add support for pkcs11: URI scheme on relevant properties 2017-01-06 15:56:11 +01:00
Lubomir Rintel
d5a1a09567 cli: support printing the pkcs11: URI scheme 2017-01-06 15:56:11 +01:00
Lubomir Rintel
afd2811028 cli: do not require a password when setting a PK
It results in a rather confusing behavior:

  # nmcli c modify wifi \
     802-1x.private-key /etc/pki/themostsecret.key \
     802-1x.private-key-password verystrong
  Error: failed to modify 802-1x.private-key: private key
  password not provided.

Moreover, the user might have a good reason for not specifying it on a command
liue and it's not strictly required anyway -- we'll do fine if we don't verify
a private key at addition time.
2017-01-06 15:14:46 +01:00
Lubomir Rintel
260563a7d9 all: use nm_utils_is_valid_iface_name() 2017-01-06 15:11:56 +01:00
Jiří Klimeš
f9648e39dd cli: enable TAB-completion for connection.lldp in interactive editor 2016-12-15 15:05:55 +01:00
Jiří Klimeš
8008770192 cli: enable TAB-completion for connection.metered in interactive editor 2016-12-15 15:05:55 +01:00
Francesco Giudici
16fdef33dd nmcli: add get functions for 802-3.speed and 802-3.duplex properties 2016-11-22 15:24:47 +01:00
Francesco Giudici
e196137f3a nmcli: enable set on 802-3 properties 2016-11-22 15:24:47 +01:00
Thomas Haller
104546cc21 cli: always include "settings-docs.c"
We now require settings-docs.c to be present. Either, configure
with --enable-gtk-doc to have it build, or use the pre-generated file
from the source tarball.
2016-11-21 20:20:14 +01:00
Lubomir Rintel
6499bb893f cli: get rid of client-global connections list
Caching it in the NmCli object is unnecessary, ugly and would be cumbersome in
future when we'll be creating the client object only when needed.
2016-11-11 16:18:03 +01:00