Commit Graph

101 Commits

Author SHA1 Message Date
Beniamino Galvani
c094ee5f90 cli: also hide phase2 private key unless --show-secrets is passed
Fixes: ca6f1e7f25
2016-05-13 13:48:43 +02:00
Beniamino Galvani
ca6f1e7f25 cli: hide secret certificate blobs unless --show-secrets is passed
Client certificate and private key blobs should be considered private
as other secrets and not shown unless the --show-secrets option is
passed.

https://bugzilla.redhat.com/show_bug.cgi?id=1184530
2016-05-13 11:49:58 +02:00
Beniamino Galvani
d5855ed807 cli: add support for DNS priority 2016-05-12 17:13:50 +02:00
Thomas Haller
7752f390c2 cli: declare external variable nm_cli in <nmcli.h> header 2016-05-03 11:53:15 +02:00
Beniamino Galvani
a9241773d7 cli: allow setting multiple IPs in bond 'arp_ip_target' option
The bond 'arp_ip_target' option contains a list of comma-separated IP
addresses; but comma is also used to separate options and so at the
moment it is not possible to specify multiple IPs as the command

 $ nmcli c m b1 bond.options \
   mode=0,arp_interval=1,arp_ip_target=1.1.1.1,2.2.2.2

interprets 2.2.2.2 as the next option.

Allows spaces to be used as separators for the IPs of the
'arp_ip_target':

 $ nmcli c m b1 bond.options \
   "mode=0,arp_interval=1,arp_ip_target=1.1.1.1 2.2.2.2"
2016-03-29 18:10:05 +02:00
Beniamino Galvani
945c459f20 cli: add support for NMSetting8021x domain-suffix-match properties 2016-03-16 17:32:17 +01:00
Thomas Haller
8bace23beb all: cleanup includes and let "nm-default.h" include "config.h"
- 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
2016-02-19 17:53:25 +01:00
Beniamino Galvani
1bb3b6a4c6 libnm-core: make ipvx.dhcp-timeout signed
Change the dhcp-timeout property in NMSettingIPConfig to int type for
consistency with the dad-timeout property. For dad-timeout -1 means
"use default value", while for dhcp-timeout probably we will never use
negative values, but it seems more correct to use the same type for
the two properties.
2016-02-16 11:37:26 +01:00
Beniamino Galvani
206e074863 libnm,core,cli: move dhcp-timeout property to generic NMSettingIPConfig
The property applies to both IPv4 and IPv6 and so it should not be in
NMSettingIP4Config but in the base class.
2016-02-16 11:37:26 +01:00
Beniamino Galvani
10b222288e wifi: don't touch by default current powersave setting
Some drivers (or things outside NM like 'powertop') may turn powersave
on, so don't touch it unless explicitly configured by user.

To achieve this, add new 'default' and 'ignore' options; the former
can be used to fall back to a globally configured setting, while the
latter tells NM not to touch the current setting.

When 'default' is specified, a missing global default configuration is
equivalent to 'ignore'.

It is possible to enable Wi-Fi power saving for all connections by
dropping a file in /etc/NetworkManager/conf.d with the following
content:

 [connection]
 wifi.powersave=3

https://bugzilla.gnome.org/show_bug.cgi?id=760125
2016-02-16 00:18:06 +01:00
Thomas Haller
e663b88c59 all/trivial: rename STRLEN() macro to NM_STRLEN()
We should not have defines/macros in header files without a nm/NM
prefix. STRLEN() was one of the few offenders.

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00048.html
2016-02-14 11:34:42 +01:00
Thomas Haller
2c2d9d2e4c build: cleanup default includes
- "gsystem-local-alloc.h" and <gio/gio.h> are already included via
  "nm-default.h". No need to include them separately.

- include "nm-macros-internal.h" via "nm-default.h" and drop all
  explict includes.

- in the modified files, ensure that we always include "config.h"
  and "nm-default.h" first. As second, include the header file
  for the current source file (if applicable). Then follow external
  includes and finally internal nm includes.

- include nm headers inside source code files with quotes

- internal header files don't need to include default headers.
  They can savely assume that "nm-default.h" is already included
  and with it glib, nm-glib.h, nm-macros-internal.h, etc.
2016-02-12 15:36:01 +01:00
Beniamino Galvani
0bfe70c574 cli: remove unused NMC_FIELDS_SETTING_*_COMMON defines 2016-02-12 13:46:12 +01:00
Dan Williams
0a12a1711c libnm-core,core,cli: fix spelling of NM_IP_TUNNEL_MODE_UNKNOWN
Fixes: b614a5ec61
Fixes: ae8c7a8967
Fixes: 570fdce93f
2016-01-20 11:27:22 -06:00
Jiří Klimeš
df6b0fa99e cli: add support for new ipv4.dad-timeout property 2016-01-20 11:53:47 +01:00
Beniamino Galvani
1ff712d5d0 ip-tunnel: add a MTU property
Add a new ip-tunnel.mtu property which can be used to change the MTU
of the tunnel interface.
2015-12-19 12:06:33 +01:00
Thomas Haller
0959109b19 cli: fix spelling in user visible texts
https://bugzilla.gnome.org/show_bug.cgi?id=759555

Reported-by: Anders Jonsson <anders.jonsson@norsjovallen.se>
2015-12-17 12:25:26 +01:00
Jiří Klimeš
89db31bf7b cli: enable TAB-completion for macvlan.mode in editor 2015-12-16 16:10:08 +01:00
Jiří Klimeš
835bdaaf1f cli: enable TAB-completion for ip-tunnel.mode in editor 2015-12-16 15:52:43 +01:00
Beniamino Galvani
7da440b798 cli: add vxlan support 2015-12-09 16:36:46 +01:00
Beniamino Galvani
c3e6e25239 cli: add macvlan support 2015-12-09 14:30:08 +01:00
Beniamino Galvani
b614a5ec61 cli: add support for IP tunnel settings 2015-12-01 17:39:41 +01:00
Jiří Klimeš
cb049d2500 cli: allow TAB-completion for tun.mode in nmcli editor
Fixes: 64c6b124d2
2015-11-28 19:48:02 +01:00
Jiří Klimeš
6ffe4b61f7 cli: fix an error in setting s390-options in nmcli editor
nmcli> set eth.s390-options portno=
(process:4711): libnm-CRITICAL **: nm_setting_wired_add_s390_option: assertion 'value_len > 0 && value_len < 200' failed
2015-11-28 19:48:02 +01:00
Jiří Klimeš
5f9b8b887d cli: fix an error in nmcli editor when setting vpn.data/vpn.secrets
nmcli> set vpn.data haha=
(process:3951): libnm-CRITICAL **: nm_setting_vpn_add_data_item: assertion 'strlen (item) > 0' failed
nmcli> set vpn.secrets haha=
(process:3951): libnm-CRITICAL **: nm_setting_vpn_add_secret: assertion 'strlen (secret) > 0' failed
2015-11-28 19:48:02 +01:00
Beniamino Galvani
64c6b124d2 cli: add support for tun settings
Add nmcli support for adding and modifying TUN/TAP connections.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
cba0f4e3c4 cli: add ipv4.dhcp-fqdn property 2015-11-23 22:09:06 +01:00
Dan Williams
06442276c9 cli: add support for GSM setting device-id, sim-id, and sim-operator-id properties 2015-11-18 15:50:52 +01:00
Dan Williams
3ac82f2c75 nmcli: add support for WiFi MAC address randomization property 2015-11-18 15:37:42 +01:00
Jiří Klimeš
b92397f925 all: fix typos in the code and update translations for that (bgo #758102)
Found by Anders Jonsson <anders.jonsson@norsjovallen.se>

https://bugzilla.gnome.org/show_bug.cgi?id=758102
2015-11-16 14:29:14 +01:00
Lubomir Rintel
4d6649fa0e cli: add addr-gen-mode property 2015-11-02 20:27:00 +01:00
Jiří Klimeš
689de5c94a vlan: (all) add VLAN MVRP flag
http://patchwork.ozlabs.org/patch/219364/
2015-10-27 17:17:05 +01:00
Beniamino Galvani
e587dcb16e wake-on-lan: add option to keep existing settings
Add a new 'ignore' option to NMSettingWired.wake-on-lan which disables
management of wake-on-lan by NetworkManager (i.e. the pre-existing
option will not be touched). Also, change the default behavior to be
'ignore' instead of 'disabled'.

https://bugzilla.gnome.org/show_bug.cgi?id=755182
2015-10-16 17:11:26 +02:00
Beniamino Galvani
0d31b95343 cli: add support for 'connection.lldp' property 2015-10-12 14:44:31 +02:00
Lubomir Rintel
7d1b2efc52 cli: add support for ipv4.dhcp-timeout property
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Jiří Klimeš
9294962cc4 cli: remove static width parameter from fields definition
The width is no longer needed because the actual field's width is computed
dynamically just before printing.
(as of commit e6870789b5)
2015-09-25 12:09:51 +02:00
Jiří Klimeš
431cc8a517 cli: support vpn.timeout property in nmcli 2015-09-21 16:59:04 +02:00
Jiří Klimeš
4485b4ec2f nmcli: wake-on-lan property set/get fixes
- accept a numeric value (decimal or hex (0x prefix))
- display a numeric value of the property in addition to the strings
- add/accept spaces between string names

to behave similar to other flags' properties.
2015-09-15 11:46:37 +02:00
Jiří Klimeš
f88ce92b25 nmcli: allow "none" value for ethernet.wake-on-lan property (rh #1260584)
Aliases "disable" and "disabled" are accepted too.

nmcli> set 802-3-ethernet.wake-on-lan none

It was possible to remove flags by setting a string containing just white
spaces, but it was user unfriendly and non-intuitive.

https://bugzilla.redhat.com/show_bug.cgi?id=1260584
2015-09-15 11:46:37 +02:00
Beniamino Galvani
04e29df47d cli: describe usage of the 'connection.metered' property 2015-09-04 10:45:04 +02:00
Dan Winship
22e1a97e12 all: drop includes to <glib/gi18n.h> for "nm-default.h"
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.
2015-08-05 15:35:51 +02:00
Thomas Haller
19c3ea948a all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
Dan Winship
3452ee2a0e all: rename nm-glib-compat.h to nm-glib.h, use everywhere
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).
2015-07-24 13:25:47 -04:00
Beniamino Galvani
de92df6c9f cli: add support for Wake-on-LAN settings 2015-07-24 14:02:59 +02:00
Jiří Klimeš
94b1b53a91 cli: fix verifying flag-based properties (rh #1244048)
Some of the properties changed from GParamSpecUInt to GParamSpecFlags, namely
NM_SETTING_VLAN_FLAGS
NM_SETTING_DCB_APP_FCOE_FLAGS
NM_SETTING_DCB_APP_ISCSI_FLAGS
NM_SETTING_DCB_APP_FIP_FLAGS
NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS
NM_SETTING_DCB_PRIORITY_GROUP_FLAGS

(commit fcfb4b40ba)

https://bugzilla.redhat.com/show_bug.cgi?id=1244048
2015-07-17 11:36:03 +02:00
Jiří Klimeš
c3093d9391 cli: add support for connection.autoconnect-slaves property 2015-06-19 09:32:58 +02:00
Thomas Haller
5eba53cd53 cli: fix metered to string property
nmc_property_connection_get_metered() must return non-localized strings
that can be parsed by nmc_property_connection_set_metered().

Fixes: f0aebfd746
2015-06-10 11:49:46 +02:00
Beniamino Galvani
f0aebfd746 cli: add support for 'metered' connection property 2015-06-09 18:15:20 +02:00
Thomas Haller
230099aa52 cli: show dns-options default value
You can reset the default value via

  $ nmcli connection modify id CON ipv4.dns-options ""

and set an empty value with

  $ nmcli connection modify id CON ipv4.dns-options " "
2015-06-05 12:26:48 +02:00
Thomas Haller
f81d7242c3 cli: add DEFINE_GETTER_WITH_DEFAULT() macro 2015-06-05 12:26:48 +02:00