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
Dan Winship
49214066a4
Fix capitalization of "InfiniBand"
...
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.
In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Jiří Klimeš
96a2bc43af
cli: add a new reason code -> string mapping
2012-03-06 11:39:11 +01:00
Jiří Klimeš
78f09078f1
cli: add Bond device support
2012-03-06 11:31:03 +01:00
Jiří Klimeš
501a389a19
cli: enable OLPC device now that we have it in libnm-glib
2012-03-02 09:02:33 +01:00
Jiří Klimeš
d4d89bb0f5
cli: add REASON field to 'nmcli dev list' output
2012-02-09 15:39:57 +01:00
Jiří Klimeš
7e4b14d5ae
cli: move IP config printing code from devices.c to common.c
...
That allows sharing the code between devices and active connections.
2012-01-06 15:20:15 +01:00
Jiří Klimeš
e4327518f3
cli: move helper IP conversion functions from devices.c to utils.c
2012-01-05 16:36:42 +01:00
Jiří Klimeš
46e336b7b4
cli: update displaying device details (IP and DHCP configuration)
2012-01-03 16:37:53 +01:00
Jiří Klimeš
1ed0476ba6
cli: add fields to 'general' group of 'nmcli dev list's output
2011-12-20 15:54:58 +01:00
Dan Winship
f49e88efe0
nmcli: add Infiniband support
2011-12-02 13:09:16 -06:00
Dan Winship
3dcfd305d6
trivial: three small obvious fixes
2011-11-17 13:25:14 -06:00
Jiří Klimeš
568820a309
cli: remove useless static function prototypes
2011-09-06 15:30:15 +02:00
Jiří Klimeš
b7e853c362
cli: use nm_access_point_get_bssid() instead of nm_access_point_get_hw_address()
...
nm_access_point_get_hw_address() is deprecated in 0.9.
Also change 'hwaddr' parameter for 'nmcli dev wifi list' to 'bssid'. 'hwaddr'
still works but is deprecated and not documented any more.
2011-09-06 13:37:23 +02:00
Kjartan Maraas
6d0d302916
build: do the right thing with config.h (bgo #644664 )
...
1) it shouldn't be included in headers
2) it should be the first thing included in source files
3) it's needed for getting translation right
2011-03-14 01:01:22 -05:00