Commit Graph

194 Commits

Author SHA1 Message Date
Dan Williams
e09550ec62 cli: clarify generic getter alloc/free behavior 2013-05-03 10:31:50 -05:00
Jiří Klimeš
47710f8211 cli: 'con up' - give bond/bridge slaves 10s to appear while activating master
If there are no slaves after the timeout, exit nmcli with an error, assuming
that NM is waiting for slaves to finish activation:
"(bondx) "IPv4 config waiting until slaves are ready"
"(bondx) "IPv6 config waiting until slaves are ready"
2013-04-30 09:28:13 +02:00
Jiří Klimeš
8215fd92fc cli: rename 'nmcli dev wifi scan' to 'nmcli dev wifi rescan' (bgo #698241) 2013-04-24 10:22:57 +02:00
Jiří Klimeš
3560024de9 cli: remove obsolete 'nmcli nm'
The functionality is present in 'general', 'networking' and 'radio'.
We changed syntax anyway, so it doesn't make much sense to keep 'nm'.
2013-04-24 10:04:43 +02:00
Jiří Klimeš
3bf97fafe7 cli: rename 'iface' --> 'ifname' in all commands 2013-04-24 10:04:37 +02:00
Jiří Klimeš
5f523d8f4d cli: accept shortcuts for --mode and --escape arguments
--mode tabular | multiline  -->  --mode t | m
--escape yes | no           -->  --escape y | n
2013-04-24 10:04:33 +02:00
Jiří Klimeš
d3ea9ee472 cli: handle NULL gracefully in nmc_arg_is_help() 2013-04-18 12:42:54 +02:00
Jiří Klimeš
7d5df73d76 cli: add nmc_arg_is_help() and use it to save some code lines 2013-04-18 11:25:49 +02:00
Pavel Šimerda
b292af8e1d trivial: avoid -Wshadow
jklimes: read vs. read(3), use 'num' instead
2013-04-15 13:43:34 +02:00
Jiří Klimeš
654a79ba88 cli: update bash completion file for the new syntax 2013-04-09 10:31:13 +02:00
Jiří Klimeš
c84315fd12 cli: 'connection delete' - do not stop on invalid connection arguments
Rather report it and continue with the next one. This is the behaviour
e.g. 'rm' command uses.
2013-04-08 16:14:56 -05:00
Jiří Klimeš
7dddead250 trivial: format nmcli usage help 2013-04-08 16:14:11 -05:00
Jiří Klimeš
15398f6fc3 trivial: fix some comments and error messages in devices.c 2013-04-08 16:14:11 -05:00
Jiří Klimeš
9ebe727d83 cli: add 'nmcli general logging'
nmcli general logging [level <log level>] [domains <log domains>]

Examples:
nmcli general logging    - print current level and domains values
nmcli general logging level ERR  - change logging level to ERR
nmcli general logging level DEBUG domains DNS  - change logging level to DEBUG and domains to DNS
nmcli g l domains DEFAULT  - set default log domains (the ones active when NM)
2013-04-08 16:14:11 -05:00
Jiří Klimeš
e2d8ca7924 cli: util function to parse command-line arguments
nmc_parse_args() - parse command-line arguments
2013-04-08 16:14:11 -05:00
Jiří Klimeš
9ddd7bc2dc cli: split 'nmcli switch' --> 'nmcli networking' and 'nmcli radio' 2013-04-08 16:14:11 -05:00
Jiří Klimeš
7e7335471c cli: rename HARDWARE -> HW in status/switch fields 2013-04-08 16:14:11 -05:00
Jiří Klimeš
2bafd7a707 cli: split 'general' into 'nmcli switch' and 'nmcli general' commands
They basically contain operations previously available via 'nmcli nm'.
'nmcli nm' is still kept for backward compatibility.

Usage:
nmcli switch  [all|networking|wifi|wwan|wimax [on/off]]
nmcli general [status|permissions]

Examples:
nmcli switch all         - show all switches
nmcli switch wifi off    - switch Wi-Fi off

nmcli g s    - show NM status
nmcli g p    - show NM permissions
2013-04-08 16:14:10 -05:00
Jiří Klimeš
7a8d654691 cli: rename 'device list' -> 'device show' and remove 'iface' keyword
Examples:
nmcli device show         - shows details for all available devices
nmcli device show eth0    - shows details for eth0
nmcli device show em1.25  - shows details for em1.25 VLAN device
2013-04-08 16:12:34 -05:00
Jiří Klimeš
51f055f74c cli: remove iface keyword for 'nmcli device disconnect'
'nmcli disconnect' allows specifying only one interface at a time.
2013-04-08 16:12:34 -05:00
Jiří Klimeš
60f54cd65d cli: 'device disconnect' - ask for interface when missing and '--ask' is present 2013-04-08 16:12:34 -05:00
Jiří Klimeš
0db4b4db90 cli: 'device wifi connect' - ask for SSID/BSSID and password if not provided
when '--ask' parameter is specified
2013-04-08 16:12:34 -05:00
Jiří Klimeš
9e8013314e cli: 'connection delete' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:12:04 -05:00
Jiří Klimeš
786ba05bfa cli: 'connection down' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:12:03 -05:00
Jiří Klimeš
97dbf98cdd cli: 'connection up' - ask for a connection name if not provided
when '--ask' switch is used
2013-04-08 16:09:23 -05:00
Jiří Klimeš
b0bee192e8 cli: add nmc_string_to_arg_array() to split a string to arguments array 2013-04-08 16:09:23 -05:00
Jiří Klimeš
7c629bf0f4 cli: nmc_get_user_input() util function for getting user input 2013-04-08 16:09:23 -05:00
Jiří Klimeš
981a687f77 cli: add '--ask' global option
It will be used to ask user for required but missing data/parameters.
2013-04-08 16:09:23 -05:00
Jiří Klimeš
abbde8d76f cli: add 'nmcli device wifi scan' command
This requests NetworkManager to perform scanning for Wi-Fi networks.
NetworkManager scans periodically, but this command can be used by impatient
users who don't want to wait for the next scan.

Direct D-Bus API call example:
gdbus call --system -d org.freedesktop.NetworkManager \
           -o /org/freedesktop/NetworkManager/Devices/2 \
           -m org.freedesktop.NetworkManager.Device.Wireless.RequestScan {}
2013-04-08 16:09:23 -05:00
Jiří Klimeš
831b7e2352 cli: move 'nmcli con status' under 'nmcli connection show' as 'active'
The static connection profiles are 'configured'.

So, now we have:
nmcli connection show configured [[id|uuid|path] <ID>]
  - shows configured connections
nmcli connection show active     [[id|uuid|path|apath] <ID>]
  - shows active connections

Without arguments the commands list all connections; with an argument, the details
of the requested connection is shown.
2013-04-08 16:09:23 -05:00
Jiří Klimeš
245d86bbcb cli: make id|uuid optional for 'nmcli connection down'
and also allow identifying connetions with 'path' and 'apath' that accepts either
the whole D-Dus path or just an index.

nmcli connection down [id|uuid|path|apath] <ID>

Example:
nmcli connection down con1
nmcli connection down con1 con2 apath 1 id my-wifi
2013-04-08 16:09:23 -05:00
Jiří Klimeš
6d5a88f02c cli: make id|uuid optional for 'nmcli connection up'
and also allow identifying connetions with 'path' that accepts either the whole
D-Dus path or just an index.

nmcli connection up [id|uuid|path] <ID>

Examples:
nmcli connection up "My Home Wi-Fi"
nmcli connection up id "My Home Wi-Fi"
nmcli connection up path /org/freedesktop/NetworkManager/Settings/18
nmcli connection up path 18

Note:
In order to be able to identify connections with just index number, the 'path'
keyword has to be provided.
2013-04-08 16:06:40 -05:00
Jiří Klimeš
4eef48d4aa cli: make id|uuid optional for 'nmcli connection delete'
and also allow identifying connetions with 'path' that accepts either the whole
D-Dus path or just an index.

nmcli connection delete [id|uuid|path] <ID>

Example:
nmcli connection delete "Wired 1" "Wired 2" "Wired 3"
nmcli connection delete id MyMain id "Quick Test 1" "Quick Test 2" path 23 path 47
2013-04-08 16:04:22 -05:00
Jiří Klimeš
1e106e31b8 cli: make id|uuid specifiers optional for 'connection list' and 'connection status'
And also allow:
 - identifying connetions with 'path'/'apath' accepting either the whole D-Dus path
   or just an index
 - multiple connections on cmdline at once

nmcli connection list   [[id|uuid|path] <ID>]
nmcli connection status [[id|uuid|path|apath] <ID>]

Examples:
nmcli c l
nmcli c l "My Wi-Fi 1" airpoirt1 cpath 23 id "My Wi-Fi 2"
nmcli c s
nmcli c s apath 1 ee19b893-e2a7-42cf-ac82-34506f07a05f
2013-04-08 15:52:15 -05:00
Jiří Klimeš
5e4d264917 cli: rename 'nm' object to 'general'
nmcli general

'nm' is kept for backward compatibility.
2013-04-08 15:52:15 -05:00
Dan Williams
38d5770f3e cli: remove VPN state workaround from 191da673a8
This is no longer required, and state is signaled correctly.
2013-04-08 11:30:32 -05:00
Dan Williams
a829c0439d cli: use nm_client_get_manager_running() instead of nmc_is_nm_running()
We now guarantee that NMClient won't dbus-activate NetworkManager so
there is no need for a custom function to prevent this.
2013-04-08 11:30:32 -05:00
Dan Williams
94ae8449c9 cli: let libnm-glib create our bus connection
libnm-glib handles connecting to the bus automatically if NULL
is passed for the bus object.  Do that; plus this lets us use
the private bus connection if present.
2013-04-08 11:30:32 -05:00
Dan Winship
5fec30d98e Revert :carrier-detect properties and associated code
Ignoring carrier is generally something you want at the machine level
(eg, for a server), not at the connection level.
2013-04-03 10:23:49 -04:00
Dan Winship
9e71bb3cd5 cli: add property get functions - returning property value for presentation
Simplify code by using property get functions, with most of them
autogenerated based on GObject properties and GValue transforms.

Based on a patch from Jiří Klimeš
2013-03-26 12:15:49 -04:00
Jiří Klimeš
113d358ce5 cli: make 'value' in NmcOutputField non const 2013-03-26 12:15:49 -04:00
Jiří Klimeš
82fb1978a4 all: use G_VALUE_INIT to initialize GValue variables
It makes the initializations more explicit.
G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
2013-03-25 08:41:18 +01:00
Jiří Klimeš
3c98c2798f cli: show connection:interface-name property for connections 2013-03-14 12:18:38 +01:00
Jiří Klimeš
5e17df86f4 cli: fix a crash in 'nmcli d l' when no connections available for a device
The regression caused by 1dca1e3c3d
2013-02-26 11:44:22 +01:00
Michael Biebl
1556a19c3e Add bash-completion file for nmcli
Based on work by Guillaume Rousse <guillomovitch@gmail.com>
2013-02-19 21:20:59 +01:00
Jiří Klimeš
1dca1e3c3d cli: print NMDevice's 'available-connections' property in CONNECTIONS section
of 'nmcli device list'

Example:
nmcli -f connections d l iface wlan5
2013-02-18 13:31:00 +01:00
Jiří Klimeš
18609641a0 cli: add CARRIER-DETECT properties for wired, infiniband, vlan settings 2013-02-18 10:09:33 +01:00
Jiří Klimeš
32b38693f1 cli: show AP and ADHOC support in WIFI-PROPERTIES for Wi-Fi devices 2013-02-12 10:01:31 +01:00
Jiří Klimeš
17aff29082 cli: add NM_ACTIVE_CONNECTION_STATE_DEACTIVATED state-to-string translation 2013-02-11 13:00:02 +01:00
Jiří Klimeš
b3edc86e78 cli: prevent possible crash if removing devices while nmcli running (bgo #693158) 2013-02-05 10:00:58 +01:00