Dan Williams
7d57386e04
cli: add support for 'nmcli dev connect ifname XXX'
2013-10-31 15:45:21 -05:00
Jiří Klimeš
9dacfd0a39
cli: always print success message (not only in --pretty mode) (rh #1006444 )
...
The commands performing actions without an output only printed a successfull
message for --pretty mode. Some users don't like this silent operation.
This commit makes nmcli print operation success unconditionally. I think that
doesn't hurt; scripts/users can ignore the message if not interested.
https://bugzilla.redhat.com/show_bug.cgi?id=1006444
2013-09-19 15:24:13 +02:00
Jiří Klimeš
e8ee5bdb0b
cli: 'dev wifi list': change default displayed columns
...
Now they are
#define NMC_FIELDS_DEV_WIFI_LIST_COMMON
"IN-USE,SSID,MODE,CHAN,RATE,SIGNAL,BARS,SECURITY"
2013-05-31 09:38:04 +02:00
Jiří Klimeš
dca3584b26
cli: 'dev wifi list': change SECURITY values
...
* remove "Encrypted" tag
The "Encrypted: " stuff was initially copied from nm-tool, but it doesn't help
here much. See also http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a734c836a56f3170202f0555f1a03c9b2835775c
for APs with WPA & RSN IEs, but no privacy flag.
* remove a space from "WPA ", etc. strings. Translators often leave it out
and thus break output.
* change "WPA" to "WPA1" to make it clearer
* use "802.1X" instead of "Enterprise" to save some characters
2013-05-31 09:38:04 +02:00
Jiří Klimeš
5f93c4314d
cli: 'dev wifi list': add IN-USE (*) field
2013-05-31 09:38:04 +02:00
Jiří Klimeš
e949365db4
cli: 'dev wifi list': 'Infrastructure' -> 'Infra', 'Unknown' -> 'N/A' in MODE
2013-05-31 09:38:03 +02:00
Jiří Klimeš
e339a259b1
cli: 'dev wifi list': add BARS column displaying signal semi-graphically
...
using unicode characters:
'_' '▂' '▄' '▆' '█'
0x5f 0x2582 0x2584 0x2586 0x2588
2013-05-31 09:38:03 +02:00
Jiří Klimeš
ac4c3f395d
cli: 'dev wifi list': add CHAN column
2013-05-31 09:38:03 +02:00
Jiří Klimeš
28704d1f42
cli: 'dev wifi list' use nm_utils_ssid_to_utf8() to display SSID; add SSID-HEX
...
This commit removes enclosing '' from SSID.
SSID-HEX is printed as a string of hex characters (each 2 chars represent one
byte).
2013-05-31 09:38:03 +02:00
Jiří Klimeš
66098fa607
cli: trivial update of NmcOutputField initializers
...
no actual change
2013-05-31 09:38:03 +02:00
Jiří Klimeš
1d1cfd77d3
cli: adapt the code for the new flags and printing facilities
...
The data are added to output_data at first, and then they are printed all at
once using print_data(), that takes care of proper alignment and display.
The static 'width' values defined in NmcOutputField columns are not used now,
but dynamically computed maximal widths override them.
2013-05-31 09:38:03 +02:00
Jiří Klimeš
0376f0be16
cli: make prompts asking for user input translatable in 'nmcli device'
2013-05-16 14:03:49 +02:00
Jiří Klimeš
2b843dac50
cli: change '--private' to 'private yes|no' in 'nmcli dev wifi connect'
...
Missing 'private' argument default to private=no, the same way as before.
2013-05-16 10:28:40 +02:00
Jiří Klimeš
fa6ecaed32
cli: remove '--nowait' and '--timeout' options and use global '--wait' instead
...
'--wait 0' corresponds to '--nowait'
'--wait n' for n > 0 corresponds to '--timeout n'
2013-05-16 10:28:40 +02:00
Dan Winship
440223fa3c
cli: sort the output of "nmcli dev"
...
Sort the output of "nmcli dev", first by state (with connected devices
first and unmanaged ones last), then by type and interface name.
2013-05-07 12:46:56 -04:00
Dan Winship
ae9a389f83
libnm-glib, cli: add nm_device_get_type_description
...
Add a new libnm-glib method to get the type description for a device,
and use it in nmcli. For most types, the type description is based on
the class name, but for NMDeviceGeneric, it comes from the
:type-description property.
2013-05-07 12:46:56 -04:00
Dan Winship
ab7ebead2c
core: add IP configuration for unmanaged devices
...
Use NMPlatform to read the IP address/route configuration of unmanaged
devices, and export that via D-Bus like we do with NM-generated IP
configs.
2013-05-07 12:46:55 -04: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š
3bf97fafe7
cli: rename 'iface' --> 'ifname' in all commands
2013-04-24 10:04:37 +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
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š
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š
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
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
Jiří Klimeš
113d358ce5
cli: make 'value' in NmcOutputField non const
2013-03-26 12:15:49 -04: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
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š
32b38693f1
cli: show AP and ADHOC support in WIFI-PROPERTIES for Wi-Fi devices
2013-02-12 10:01:31 +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
Thomas Graf
789f8c730d
cli: add bridge support
2012-11-30 13:21:51 -06:00
Jiří Klimeš
35689c7bd0
cli: allow next_arg() to move arguments past the last one
2012-11-20 15:20:38 +01:00
Jiří Klimeš
e9e2c5645f
cli: replace 'dev' and 'con' OBJECTs by 'device', resp. 'connection'
...
Shorter forms work as previously. Thus, all of these commands are valid:
nmcli device, nmcli devic, nmcli devi, nmcli dev, nmcli de, nmcli d
nmcli connection, nmcli connectio, ..., nmcli conn, nmcli con, ..., nmcli c
2012-11-13 15:41:20 +01:00
Jiří Klimeš
c8974bc32d
cli: allow more forms of "help" command showing OBJECTs' description
...
allow "-[h]elp" and "--[h]elp" in addition to "help"
2012-11-13 15:41:20 +01:00
Jiří Klimeš
8a0e928aed
cli/examples: NM_802_11_MODE_AP mode is not valid for NMAccessPoint objects
2012-11-01 15:40:27 +01:00
Jiří Klimeš
16edfae11a
cli: add VLAN section to 'nmcli dev list' for VLAN devices
...
Now, it just contains one item - ID showing VLAN ID of the device.
2012-10-22 15:18:34 +02:00
Jiří Klimeš
65fc99911d
cli: add BOND section to 'nmcli dev list' for bond devices
...
Now, it just contains one item - SLAVES listing all slave devices of the bond
device.
2012-10-22 14:31:11 +02:00
Jan Luebbe
f9c72dee3e
wifi: support ap-mode with wpa_supplicant
...
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.
If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
2012-10-17 12:08:11 -05:00
Jiří Klimeš
de763a42ec
cli: put indexes into [] for AP and NSP in 'nmcli dev list' output
...
AP1 -> AP[1]
NSP1 -> NSP[1]
It's more readable (section names are AP an NSP) and it makes indexing
format conform to other data, like IP4.DNS[1].
2012-08-29 10:39:09 +02:00
Jiří Klimeš
2efeac8c5f
cli: add DRIVER-VERSION and FIRMWARE-VERSION fields to driver properties listing
2012-06-08 13:44:43 +02:00
Jiří Klimeš
29a8fbaca3
cli: list 'autoconnect' property in 'nmcli dev list'
2012-05-23 13:25:43 +02:00
Pantelis Koukousoulas
8039dd30d8
adsl: add libnm-glib and nmcli code
...
For the finale, this is the libnm-glib and nmcli part of the support,
with this you can now make a full pppoatm connection from NetworkManager
by configuring it in system scope in a keyfile.
As an example, here is mine:
(password and username snipped for obvious reasons)
[connection]
id=MYISP
uuid=34d04e69-fdd9-4231-af2c-25ed1f34dc1e
type=adsl
timestamp=1304621332
[adsl]
username=user@myisp.com
password=mypassword
vpi=8
vci=35
encapsulation=vcmux
protocol=pppoa
[ipv6]
method=ignore
[ipv4]
method=auto
Extract from logs:
NetworkManager[29155]: <info> Activation (ueagle-atm0) starting connection 'MYISP'
NetworkManager[29155]: <info> (ueagle-atm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) starting...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) successful.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) scheduled.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) started...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: config -> ip-config (reason 'none') [50 70 0]
NetworkManager[29155]: <info> starting PPP connection
NetworkManager[29155]: <debug> [1304671146.590156] [nm-ppp-manager.c:1047] nm_ppp_manager_start(): command line: /usr/sbin/pppd nodetach lock nodefaultroute user user@myisp.com plugin pppoatm.so 8.35 noipdefault noauth usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/0 plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so
NetworkManager[29155]: <info> pppd started with pid 29175
NetworkManager[29155]: <debug> [1304671146.591235] [NetworkManagerUtils.c:816] nm_utils_get_proc_sys_net_value(): (ueagle-atm0): error reading /proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra: (4) Failed to open file '/proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra': No such file or directory
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) complete.
Plugin pppoatm.so loaded.
Plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so loaded.
** Message: nm-ppp-plugin: (plugin_init): initializing
** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
NetworkManager[29155]: <debug> [1304671146.612937] [nm-udev-manager.c:621] handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0'
NetworkManager[29155]: <debug> [1304671146.613134] [nm-udev-manager.c:525] net_add(): ignoring interface with type 512
NetworkManager[29155]: <debug> [1304671146.617308] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x1090
Using interface ppp0
Connect: ppp0 <--> 8.35
** Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate'
** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting credentials...
NetworkManager[29155]: <debug> [1304671149.639511] [nm-agent-manager.c:1044] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/0 (adsl)
NetworkManager[29155]: <debug> [1304671149.639684] [nm-settings-connection.c:717] nm_settings_connection_get_secrets(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets requested flags 0x1 hint 'password'
NetworkManager[29155]: <debug> [1304671149.640950] [nm-agent-manager.c:959] get_start(): (0x9b4ad10/adsl) system settings secrets sufficient
NetworkManager[29155]: <debug> [1304671149.641332] [nm-settings-connection.c:573] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) existing secrets returned
NetworkManager[29155]: <debug> [1304671149.641541] [nm-settings-connection.c:579] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets request completed
NetworkManager[29155]: <debug> [1304671149.643074] [nm-settings-connection.c:618] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) new agent secrets processed
** Message: nm-ppp-plugin: (get_credentials): got credentials from NetworkManager
PAP authentication succeeded
** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
local IP address 94.70.90.201
remote IP address 80.106.108.12
primary DNS address 195.170.0.1
secondary DNS address 195.170.2.2
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: <debug> [1304671150.607440] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: <info> PPP manager(IP Config Get) reply received.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) started...
NetworkManager[29155]: <debug> [1304671150.608918] [nm-system.c:222] sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: <info> (ueagle-atm0): device state change: ip-config -> activated (reason 'none') [70 100 0]
NetworkManager[29155]: <info> Policy set 'MYISP' (ppp0) as default for IPv4 routing and DNS.
NetworkManager[29155]: <info> Activation (ueagle-atm0) successful, device activated.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) complete.
Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2012-05-18 15:42:56 -05:00
Jiří Klimeš
191da673a8
cli: show progress in --pretty mode for 'nmcli con up'
...
We need to use a workaround for VPN connection state. There is a bug somewhere
causing that vpn-state-changed signal is not issued on active VPN connection.
Debugging showed that D-Bus PropertiesChanged and VpnStateChanged signals are
not processed properly. That's why libnm-glib's VPN connection object is not
updated. The issue may lie in libnm-glib or even in dbus-glib.
I wasn't able to get VpnStateChanged signal via dbus-glib
(dbus_g_proxy_add_signal() and dbus_g_proxy_connect_signal()), however received
the signal successfully using GDBus.
Until the issue is analyzed and fixed, we need to ask for VPN state of active
VPN connection every second in order to show progress and exit correctly.
2012-05-09 14:19:03 +02:00
Jiří Klimeš
d58c32d214
cli: show progress in --pretty mode for 'nmcli dev disconnect'
2012-05-09 13:37:28 +02:00
Jiří Klimeš
c878ad8214
cli: trivial, fix up spacing
2012-04-28 22:54:02 +02:00
Jiří Klimeš
38a988cb5e
cli: add 'connect to SSID' feature: nmcli dev wifi connect <SSID> ...
...
This is similar to clicking a Wi-Fi network's SSID in a GUI applet.
The command does this:
- creates new connection (fills the user data specified via options, the
connection is then completed with default parameters by NM)
- and then activates the connection on a Wi-Fi device.
WPA-Enterprise is not supported as it requires a plethora of parameters and
they can't be obtained automatically.
Also, the created connection uses 'auto' IP method, which means that if the
Wi-Fi network doesn't support DHCP, the connection will albeit be created,
however the activation will fail (IP configuration won't be available).
2012-04-28 22:33:30 +02:00
Dan Williams
bc50a2a75b
cli: add VLAN device support
2012-03-07 11:45:40 -06:00