Commit Graph

132 Commits

Author SHA1 Message Date
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š
07fc3dcb90 api: add NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED reason and use that 2012-09-24 10:38:26 +02:00
Jiří Klimeš
dc3b2a4c81 cli: print 'secondaries' property of 'connection' setting
nmcli -f connection con list id "my connection"
2012-09-24 10:38:17 +02:00
Jiří Klimeš
004ea8166a cli: add NM_DEVICE_STATE_REASON_SSID_NOT_FOUND reason-to-string mapping 2012-09-21 10:04:28 +02:00
Mick Boldon
d8b2e8c64a cli: fix "etc." typo (bgo #681173)
https://bugzilla.gnome.org/show_bug.cgi?id=681173
2012-09-10 13:09:09 +02:00
Jiří Klimeš
bafd97b087 cli: add missing properties of 'connection' setting
zone
master
slave-type
2012-09-05 16:14:37 +02:00
Jiří Klimeš
c4bb7f26a8 cli: add NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE reason-to-string mapping 2012-08-30 14:14:27 +02: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š
853803c2f0 cli: use an error quark for domain in g_set_error() instead of 0 (rh #842975)
glib 2.32 makes a runtime check that domain is not NULL:
GLib-WARNING **: (gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)
2012-07-25 13:57:45 +02:00
Jiří Klimeš
05a83b909d cli: add 'ip6-privacy' property of ipv6 setting 2012-07-18 12:56:31 +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š
5903392887 cli: free strings when printing adsl setting 2012-06-07 12:28:06 +02:00
Jiří Klimeš
56d5a57728 cli: add NM_DEVICE_STATE_REASON_BR2684_FAILED reason-to-string mapping 2012-06-07 12:08:22 +02:00
Jiří Klimeš
716a09d7ac cli: use "--" instead of "no set" for NULL strings 2012-06-04 12:25:43 +02:00
Jiří Klimeš
29a8fbaca3 cli: list 'autoconnect' property in 'nmcli dev list' 2012-05-23 13:25:43 +02:00
Jiří Klimeš
a8076f0d9d cli: fill active connections' data even if we can't get NMConnection
This can happen e.g. when D-Bus limits number of replies and there's
a lot of connections. Then nm_remote_settings_list_connections() won't
return all connections and the connection that was activated can be among
the missing connections.
2012-05-22 17:05:34 +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š
c5d75dcdfa cli: fix 'nm -nocheck con up'
When '-nocheck' option was used, NMClient object was created later in the
operation process.
This caused that the callback in nm_client_activate_connection() was not
called. It's fixed by creating NMClient early.
2012-05-09 14:19:11 +02: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š
0a98d14e48 cli: add a command for listing permissions - nmcli nm permissions 2012-04-30 13:32:55 +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 Winship
8a2267ab6b Fix a few misc issues noticed by Coverity 2012-04-05 13:30:09 -04:00
Jiří Klimeš
a11067f584 libnm-glib: add errors to device classes and nm_device_connection_compatible()
Add nm_device_connection_compatible() that returns an error when it fails.
nm_device_connection_valid() does the same work except it doesn't set GError.
2012-03-16 09:54:36 +01:00
Jiří Klimeš
366ac3c5a2 cli: use nm_device_connection_valid() function from libnm-glib
to verify whether device and connection match and don't duplicate the code
in nmcli.
2012-03-14 14:49:44 +01:00
Dan Williams
c113bf222a cli: fix VLAN priority map listing 2012-03-09 14:56:11 -06: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
Dan Williams
4fc8b8ccd0 cli: don't require a device for virtual connections
They may not have had their devices created yet, and the activation
process creates the device, so allow NULL device paths for
activation.
2012-03-06 12:01:49 -06: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š
5519ff9952 cli: add 'vlan' setting 2012-03-05 09:52:10 +01:00
Jiří Klimeš
71e7434d1a cli: add 'bond' setting 2012-03-05 09:52: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
Colin Walters
74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Jiří Klimeš
d4d89bb0f5 cli: add REASON field to 'nmcli dev list' output 2012-02-09 15:39:57 +01:00
Jiří Klimeš
8e22a535cc cli: add 'transport-mode' property of infiniband setting 2012-02-01 11:47:19 +01:00
Jiří Klimeš
3a6c69d576 cli: add 'pac-file' property of 802-1x setting 2012-02-01 10:50:56 +01:00
Thomas Graf
471fef2ad5 cli: print NMActiveConnection master property as MASTER-PATH
This is a proposal to include the NMActiveConnection master property in
nmcli con status.

Feel free to suggest a more user friendly method of printing this
information.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-25 11:24:50 -06:00
Jiří Klimeš
659c22ccf6 cli: fix 'nmcli con delete' (rh #771258)
The command didn't delete the connection, because nmcli exited before NM could
check permissions (actually ConsoleKit didn't see the process).
Now nmcli waits for "Removed" signal or D-Bus return (error) message on "Delete"
method call.
2012-01-10 16:30:04 +01:00
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Jiří Klimeš
b76d7cd240 cli: added 'con status id|uuid|path <con>' for listing active connection details
'nmcli con status' still prints brief active connection list.
'nmcli con status id|uuid|path <con>' shows details of the selected active
connection.
2012-01-06 15:20:15 +01:00
Jiří Klimeš
a2e86dfb7d cli: fix a crash (due to freeing static string) 2012-01-06 15:20:15 +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š
c15d047b46 cli: allow field values to be null-terminated string arrays
Field values can now be string arrays. print_fields() recognizes the format and
prints values accordingly.
Setter functions was added to facilitate setting string vs. array:
set_val_str(), set_val_arr()
2012-01-03 15:07:17 +01:00