Commit Graph

326 Commits

Author SHA1 Message Date
Jiří Klimeš
18b7a9a42f cli: ask user before requiring optional parameters for 'nmcli -a con add type tun'
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
Jiří Klimeš
1b0be2bab0 cli: fix a crash in 'nmcli -a con clone'
when providing empty arguments.

Fixes: 0c65b28960
2015-11-28 19:48:02 +01:00
Jiří Klimeš
4a06701e88 cli: add 'strongswan' and 'fortisslvpn' to known VPN types 2015-11-25 17:14:02 +01:00
Jiří Klimeš
579fd36566 cli: improve error messages for 'nmcli device set'
Fixes: 4dffbf8f6a
2015-11-25 16:39:00 +01:00
Beniamino Galvani
c223e811f1 nmcli/bash-completion: add completion for 'tun' connection mode 2015-11-25 11:53:04 +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
Jiří Klimeš
847f3b646b cli: make a prompt a translatable string in do_connection_clone()
Fixes: 0c65b28960
2015-11-24 15:22:06 +01:00
Beniamino Galvani
cba0f4e3c4 cli: add ipv4.dhcp-fqdn property 2015-11-23 22:09:06 +01:00
Joel Holdsworth
8051038b4d build/nmcli: make nmcli build optional
https://mail.gnome.org/archives/networkmanager-list/2015-November/msg00043.html
https://mail.gnome.org/archives/networkmanager-list/2015-November/msg00063.html
2015-11-19 13:51:59 +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š
0c65b28960 cli: add 'nmcli connection clone' for cloning connections (bgo #757627)
Synopsis:
nmcli connection clone [--temporary] [id|uuid|path] <ID> <new name>

It copies the <ID> connection as <new name>. The command is very useful
if there is a connection, but another one is needed for a related
configuration. One can copy the existing profile and modify it for the
new situation.

For example:
$ nmcli con clone main-eth second-eth
$ nmcli con modify second-eth connection.interface-name em4

https://bugzilla.gnome.org/show_bug.cgi?id=757627
2015-11-18 09:37:44 +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
4b7cb5a634 nmcli/bash-completion: fix --show-password parsing
Fixes: 2f52a10be1
2015-11-12 13:49:55 +01:00
Jiří Klimeš
0dc48370b4 cli: print a warning if BSSID is given instead of SSID for hidden AP
$ nmcli dev wifi connect 00:22:6B:EB:1D:CA hidden yes
Warning: '00:22:6B:EB:1D:CA' should be SSID for hidden APs; but it looks like a BSSID.
Error: Failed to add/activate new connection: 802-11-wireless.ssid: connection does not match access point
2015-11-11 09:47:51 +01:00
Beniamino Galvani
5b3137984d cli: add command for displaying LLDP neighbors
The list of LLDP neighbors is available through the D-Bus interface
and libnm already provides functions to retrieve it; make the list
available through nmcli as well. Sample output:

  $ nmcli device lldp
  NEIGHBOR[0].DEVICE:                     eth0
  NEIGHBOR[0].CHASSIS-ID:                 00:13:21:58:CA:42
  NEIGHBOR[0].PORT-ID:                    1
  NEIGHBOR[0].PORT-DESCRIPTION:           1
  NEIGHBOR[0].SYSTEM-NAME:                ProCurve Switch 2600-8-PWR
  NEIGHBOR[0].SYSTEM-DESCRIPTION:         ProCurve J8762A Switch 2600-8-PWR, revision H.08.89
  NEIGHBOR[0].SYSTEM-CAPABILITIES:        20 (mac-bridge,router)
  NEIGHBOR[1].DEVICE:                     eth2
  NEIGHBOR[1].CHASSIS-ID:                 00:01:30:F8:AD:A2
  NEIGHBOR[1].PORT-ID:                    1/1
  NEIGHBOR[1].PORT-DESCRIPTION:           Summit300-48-Port 1001
  NEIGHBOR[1].SYSTEM-NAME:                Summit300-48
  NEIGHBOR[1].SYSTEM-DESCRIPTION:         Summit300-48 - Version 7.4e.1 (Build 5)
  NEIGHBOR[1].SYSTEM-CAPABILITIES:        20 (mac-bridge,router)

https://bugzilla.gnome.org/show_bug.cgi?id=757307
2015-11-10 14:06:02 +01:00
Jiří Klimeš
2f52a10be1 cli: add '--show-password' option for 'nmcli device wifi hotspot'
It is useful to show nmcli-generated hotspot password (if a user does not
provide his own password). Without the option the user would have to look into
the generated profile in order to find out the password.
2015-11-10 09:15:06 +01:00
Jiří Klimeš
781d24f1dd cli: add 'password' option for 'nmcli device wifi hotspot'
It allows user provided password to be used to secure the hotspot.
Otherwise, nmcli will generate a suitable password.
2015-11-10 09:10:48 +01:00
Jiří Klimeš
d6427d7198 cli: add 'nmcli device wifi hotspot' command
Synopsis:
nmcli device wifi hotspot [ifname <ifname>] [con-name <name>] [ssid <SSID>]
                          [band a|bg] [channel <channel>]
2015-11-10 09:08:05 +01:00
Jiří Klimeš
cd217db21c cli: move unique_connection_name() to common.c as nmc_unique_connection_name() 2015-11-09 16:17:39 +01:00
Thomas Haller
6a82b4e2ed cli: fix nmcli device set DEV managed true
Fixes: 4dffbf8f6a
2015-11-06 14:52:11 +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
Jiří Klimeš
696a443e98 cli: improve error reporting of missing 'ifname' parameter
Example:
before:
$ nmcli c add type gsm con-nameX aaa ifname fsd
Error: 'ifname' argument is required.

now:
$ nmcli c add type gsm con-nameX aaa ifname fsd
Error: mandatory 'ifname' not seen before 'con-nameX'.
2015-10-23 12:28:29 +02:00
Jiří Klimeš
b45bd96d89 cli: trivial: correct argument description for nmc_parse_args() 2015-10-23 12:28:29 +02:00
Jiří Klimeš
91dde2c865 nmcli: fix bash completion of words containing colon (rh #1271271)
Test:
$ sudo ip link add a🅱️c type dummy
$ nmcli device delete<Tab><Tab>
$ nmcli device delete a<Tab>

See also:
http://stackoverflow.com/questions/28479216/how-to-give-correct-suggestions-to-tab-complete-when-my-words-contains-colons
http://stackoverflow.com/questions/2805412/bash-completion-for-maven-escapes-colon/12495727

Related: https://bugzilla.gnome.org/show_bug.cgi?id=745157

https://bugzilla.redhat.com/show_bug.cgi?id=1271271
2015-10-20 12:00:39 +02: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
e9c9d02452 cli: fix creation of VLANs with a given MAC address
When a VLAN connection was added with command:

  nmcli c add type vlan ifname v10 id 10 dev 00:11:22:33:44:55

nmcli tried to assign a byte-array value to the ethernet.mac-address
string property, resulting in a invalid connection which failed to
verify. Fix this and set the value as plain string.
2015-10-15 14:30:24 +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
Thomas Haller
7bf10a75db build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h"
For libnm library, "nm-dbus-interface.h" contains defines like the D-Bus
paths of NetworkManager. It is desirable to have this header usable without
having a dependency on "glib.h", for example for a QT application. For that,
commit c0852964a8 removed that dependancy.

For libnm-glib library, the analog to "nm-dbus-interface.h" is
"NetworkManager.h", and the same applies there. Commit
159e827a72 removed that include.
However, that broke build on PackageKit [1] which expected to get the
version macros by including "NetworkManager.h". So at least for libnm-glib,
we need to preserve old behavior so that a user including
"NetworkManager.h" gets the version macros, but not "glib.h".

Extract the version macros to a new header file "nm-version-macros.h".
This header doesn't include "glib.h" and can be included from
"NetworkManager.h". This gives as previous behavior and a glib-free
include.

For libnm we still don't include "nm-version-macros.h" to "nm-dbus-interface.h".
Very few users will actually need the version macros, but not using
libnm.
Users that use libnm, should just include (libnm's) "NetworkManager.h" to
get all headers.
As a special case, a user who doesn't want to use glib/libnm, but still
needs both "nm-dbus-interface.h" and "nm-version-macros.h", can include
them both separately.

[1] https://github.com/hughsie/PackageKit/issues/85

Fixes: 4545a7fe96
2015-09-30 23:10:29 +02:00
Jiří Klimeš
e7ed259fdc cli: print s390 subchannels for devices that have that 2015-09-29 09:31:41 +02:00
Jiří Klimeš
ecf0849355 cli: allow 'ipv6' and 'ppp' settings for GSM and CDMA connections (rh #1265993)
Otherwise the settings cannot be changed.

https://bugzilla.redhat.com/show_bug.cgi?id=1265993
2015-09-25 15:50:22 +02:00
Jiří Klimeš
0c1124b903 cli: fix error string format
clients/cli/.libs/nmcli con mod profile con.zone
Error: Error: value for 'con.zone' is missing..

Fixes: 15149d915f
2015-09-25 15:50:22 +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
Thomas Haller
4cb0ab5d29 cli: fix type on printed nmcli error message
Fixes: 4dffbf8f6a
2015-09-21 18:25:50 +02:00
Thomas Haller
fcc51f1ab7 nmcli/bash-completion: fix completion for device names for nmcli device set
Fixes: 7405d5c7b7
2015-09-21 18:25:50 +02:00
Jiří Klimeš
431cc8a517 cli: support vpn.timeout property in nmcli 2015-09-21 16:59:04 +02:00
Jiří Klimeš
290c1626b9 cli: allow creating ADSL connections with 'nmcli connection add' (rh #1264089)
https://bugzilla.redhat.com/show_bug.cgi?id=1264089
2015-09-21 15:21:51 +02:00
Jiří Klimeš
5502d8691a cli: initialize adsl.protocol in editor when creating a new connection
The protocol is required and it is nice to have a valid initial value for
the property.
2015-09-21 15:21:51 +02:00
Thomas Haller
7405d5c7b7 nmcli: extend nmcli device set command to accept explicit ifname specifier
Without it, you cannot set the properties of a device named "help".
Now you can with:

  $ nmcli device set ifname help autoconnect no
2015-09-18 13:14:44 +02:00
Lubomir Rintel
4dffbf8f6a cli: add nmcli device set command
Co-Authored-By: Thomas Haller <thaller@redhat.com>
2015-09-18 13:14:35 +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
Lubomir Rintel
1126571735 cli: terminate when the input terminal goes away
Readline treats I/O errors on stdin as a newline, thus if the terminal
disappears with SIGHUP masked we just loop until the end of times and beyond.
2015-08-20 17:39:18 +02:00
Jiří Klimeš
5955a66e09 cli: fix connecting to a hidden SSID with 'nmcli dev wifi connect' (bgo #752173)
We have to set 802-11-wireless.hidden=true to be able to connect to hidden SSIDs.
nmcli user indicates hidden SSID with 'hidden yes' parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=752173
2015-08-14 12:42:56 +02:00
Jiří Klimeš
e247567d87 cli: add 'ssid' parameter for 'nmcli device wifi rescan'
'ssid' can repeat when more SSIDs should be scanned, e.g.
$ nmcli dev wifi rescan ssid "hidden cafe" ssid AP12 ssid "my home Wi-Fi"

Bash completion fixed by thaller@redhat.com
2015-08-14 12:42:15 +02:00