Re: [PATCH 2/2] device: add statistics interface

2016-06-07 Thread Dan Williams
On Fri, 2016-06-03 at 18:44 +0200, Alfonso Sanchez-Beato wrote:
> Add statistics interface to all device instances. When active, the
> properties of this interface are refreshed whenever there is network
> activity for the device.
> 
> Activation is performed by changing RefreshRateMs property. If set to
> zero, the interface is deactivated. If set to other value, the rest
> of
> the interface properties are refreshed whenever the related network
> metric changes, being RefreshRateMs the minimum time between property
> changes, in milliseconds.
> 

For the netlink parts, is there any way we could extend the NMPlatform
to subscribe to stats and emit signals when things change for a device?
 There's an awful lot of netlink code in nm-device-statistics.c that
probably duplicates what the platform currently does.

The overall approach and D-Bus interface parts look OK to me.

Dan

> ---
>  introspection/Makefile.am  |   6 +-
>  introspection/nm-device-statistics.xml |  43 
>  libnm-core/nm-dbus-interface.h |   1 +
>  src/Makefile.am|   2 +
>  src/devices/nm-device-private.h|   3 +
>  src/devices/nm-device-statistics.c | 407
> +
>  src/devices/nm-device-statistics.h |  33 +++
>  src/devices/nm-device.c| 102 -
>  src/devices/nm-device.h|   4 +
>  src/nm-types.h |   1 +
>  10 files changed, 600 insertions(+), 2 deletions(-)
>  create mode 100644 introspection/nm-device-statistics.xml
>  create mode 100644 src/devices/nm-device-statistics.c
>  create mode 100644 src/devices/nm-device-statistics.h
> 
> diff --git a/introspection/Makefile.am b/introspection/Makefile.am
> index 3a62793..f72703d 100644
> --- a/introspection/Makefile.am
> +++ b/introspection/Makefile.am
> @@ -41,6 +41,8 @@ nodist_libnmdbus_la_SOURCES = \
>   nmdbus-device-modem.h \
>   nmdbus-device-olpc-mesh.c \
>   nmdbus-device-olpc-mesh.h \
> + nmdbus-device-statistics.c \
> + nmdbus-device-statistics.h \
>   nmdbus-device-team.c \
>   nmdbus-device-team.h \
>   nmdbus-device-tun.c \
> @@ -111,7 +113,8 @@ DBUS_INTERFACE_DOCS = \
>   nmdbus-device-veth-
> org.freedesktop.NetworkManager.Device.Veth.xml \
>   nmdbus-settings-org.freedesktop.NetworkManager.Settings.xml
> \
>   nmdbus-device-ethernet-
> org.freedesktop.NetworkManager.Device.Wired.xml \
> - nmdbus-ip4-config-
> org.freedesktop.NetworkManager.IP4Config.xml
> + nmdbus-ip4-config-
> org.freedesktop.NetworkManager.IP4Config.xml \
> + nmdbus-device-statistics-
> org.freedesktop.NetworkManager.Device.Statistics.xml
>  
>  define _make_nmdbus_rule
>  $(1): $(patsubst nmdbus-%.c,nm-%.xml,$(1))
> @@ -150,6 +153,7 @@ EXTRA_DIST = \
>   nm-device-macvlan.xml \
>   nm-device-modem.xml \
>   nm-device-olpc-mesh.xml \
> + nm-device-statistics.xml \
>   nm-device-team.xml \
>   nm-device-tun.xml \
>   nm-device-veth.xml \
> diff --git a/introspection/nm-device-statistics.xml
> b/introspection/nm-device-statistics.xml
> new file mode 100644
> index 000..08a700e
> --- /dev/null
> +++ b/introspection/nm-device-statistics.xml
> @@ -0,0 +1,43 @@
> +
> +
> +   name="org.freedesktop.NetworkManager.Device.Statistics">
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +  
> +
> diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-
> interface.h
> index 1e0fbe6..20eccb8 100644
> --- a/libnm-core/nm-dbus-interface.h
> +++ b/libnm-core/nm-dbus-interface.h
> @@ -68,6 +68,7 @@
>  #define NM_DBUS_INTERFACE_DEVICE_VXLAN  NM_DBUS_INTERFACE_DEVICE
> ".Vxlan"
>  #define NM_DBUS_INTERFACE_DEVICE_GRENM_DBUS_INTERFACE_DEVICE
> ".Gre"
>  #define NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL  NM_DBUS_INTERFACE_DEVICE
> ".IPTunnel"
> +#define NM_DBUS_INTERFACE_DEVICE_STATISTICS NM_DBUS_INTERFACE_DEVICE
> ".Statistics"
>  
>  #define
> NM_DBUS_INTERFACE_SETTINGS"org.freedesktop.NetworkManager.Set
> tings"
>  #define
> NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Se
> ttings"
> diff --git a/src/Makefile.am b/src/Makefile.am
> index e61e5aa..d9c8eba 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -289,6 +289,8 @@ libNetworkManager_la_SOURCES = \
>   devices/nm-device-generic.h \
>   devices/nm-device-logging.h \
>   devices/nm-device-private.h \
> + devices/nm-device-statistics.c \
> + devices/nm-device-statistics.h \
>   \
>   dhcp-manager/nm-dhcp-client.c \
>   dhcp-manager/nm-dhcp-client.h \
> diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-
> private.h
> index 418ae2d..addeda0 100644
> --- a/src/devices/nm-device-private.h
> +++ b/src/devices/nm-device-private.h
> @@ -111,6 +111,9 @@ void nm_device_ip_method_failed (NMDevice *self,
> int family, NMDeviceStateReason
>  
>  gboolean nm_device_ipv6_sysctl_set (NMDevice *self, co

Re: Fwd: How to get GPS NMEA in C from ModemManager?

2016-06-07 Thread Dan Williams
On Tue, 2016-06-07 at 14:28 -0700, serena dadak wrote:
> not pretty for sure.
> Any samples on using libmm calls? Would that be a possibility?

libmm-glib is based off GLib/GDBus, so yes that's a possibility.  See
cli/mmcli-modem-location.c for how that would work, I think the code
there can also run synchronously and not require an external event
loop.

Dan

> On Tue, Jun 7, 2016 at 2:10 PM, Dan Williams  wrote:
> 
> > 
> > On Tue, 2016-06-07 at 13:40 -0700, serena dadak wrote:
> > > 
> > > hello there
> > > 
> > > Is there any sample code to get NMEA strings from MM in C?
> > > I looked at the example codes in NM but didn't have much luck on
> > > finding
> > > samples for GPS.
> > You'd use the libdbus C bindings or (easier) glib-based ones with
> > GDBus.  For example, raw libdbus looks like this:
> > 
> > 
> > http://maemo.org/development/training/maemo_platform_development_co
> > ntent/plain_html/node10/
> > 
> > and it isn't exactly pretty.  Using a binding, whether that's dbus-
> > glib, dbus-qt, GDBus, or something else is usually a lot easier.
> > 
> > Dan
> > 
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Fwd: How to get GPS NMEA in C from ModemManager?

2016-06-07 Thread Bastien Nocera
On Tue, 2016-06-07 at 16:10 -0500, Dan Williams wrote:
> On Tue, 2016-06-07 at 13:40 -0700, serena dadak wrote:
> > hello there
> > 
> > Is there any sample code to get NMEA strings from MM in C?
> > I looked at the example codes in NM but didn't have much luck on
> > finding
> > samples for GPS.
> 
> You'd use the libdbus C bindings or (easier) glib-based ones with
> GDBus.  For example, raw libdbus looks like this:
> 
> http://maemo.org/development/training/maemo_platform_development_cont
> ent/plain_html/node10/
> 
> and it isn't exactly pretty.  Using a binding, whether that's dbus-
> glib, dbus-qt, GDBus, or something else is usually a lot easier.

Or use geoclue, and get all that for free:
https://www.freedesktop.org/software/geoclue/docs/libgeoclue/GClueSimple.html

Cheers
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Fwd: How to get GPS NMEA in C from ModemManager?

2016-06-07 Thread serena dadak
not pretty for sure.
Any samples on using libmm calls? Would that be a possibility?

On Tue, Jun 7, 2016 at 2:10 PM, Dan Williams  wrote:

> On Tue, 2016-06-07 at 13:40 -0700, serena dadak wrote:
> > hello there
> >
> > Is there any sample code to get NMEA strings from MM in C?
> > I looked at the example codes in NM but didn't have much luck on
> > finding
> > samples for GPS.
>
> You'd use the libdbus C bindings or (easier) glib-based ones with
> GDBus.  For example, raw libdbus looks like this:
>
>
> http://maemo.org/development/training/maemo_platform_development_content/plain_html/node10/
>
> and it isn't exactly pretty.  Using a binding, whether that's dbus-
> glib, dbus-qt, GDBus, or something else is usually a lot easier.
>
> Dan
>
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager WiFi AP Mode

2016-06-07 Thread Dan Williams
On Tue, 2016-06-07 at 13:00 -0700, Ali Nematollahi wrote:
> I've been using AP mode for over a year with the same set up. I use
> many
> commands to set it up but it has been working perfectly fine. Here is
> the
> output you requested:

I misread the error message; it's not from the kernel, but from
wpa_supplicant.  Your supplicant hasn't been built with AP mode
support, so you'll need to rebuild it with CONFIG_AP=y in the build
config.  NM is supposed to detect that the supplicant doesn't have that
support, but I guess that's not working for some reason.

Dan
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Fwd: How to get GPS NMEA in C from ModemManager?

2016-06-07 Thread Dan Williams
On Tue, 2016-06-07 at 13:40 -0700, serena dadak wrote:
> hello there
> 
> Is there any sample code to get NMEA strings from MM in C?
> I looked at the example codes in NM but didn't have much luck on
> finding
> samples for GPS.

You'd use the libdbus C bindings or (easier) glib-based ones with
GDBus.  For example, raw libdbus looks like this:

http://maemo.org/development/training/maemo_platform_development_content/plain_html/node10/

and it isn't exactly pretty.  Using a binding, whether that's dbus-
glib, dbus-qt, GDBus, or something else is usually a lot easier.

Dan
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Fwd: How to get GPS NMEA in C from ModemManager?

2016-06-07 Thread serena dadak
hello there

Is there any sample code to get NMEA strings from MM in C?
I looked at the example codes in NM but didn't have much luck on finding
samples for GPS.

sincerely
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager WiFi AP Mode

2016-06-07 Thread Ali Nematollahi
I've been using AP mode for over a year with the same set up. I use many
commands to set it up but it has been working perfectly fine. Here is the
output you requested:

phy phy0 info
Wiphy phy0
Band 1:
Capabilities: 0x1072
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 16383 bytes (exponent: 0x001)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT TX/RX MCS rate indexes supported: 0-7
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm) (passive scanning, no
IBSS)
* 2472 MHz [13] (20.0 dBm) (passive scanning, no
IBSS)
* 2484 MHz [14] (20.0 dBm) (passive scanning, no
IBSS)
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Band 2:
Capabilities: 0x72
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 16383 bytes (exponent: 0x001)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT TX/RX MCS rate indexes supported: 0-7
Frequencies:
* 5040 MHz [8] (disabled)
* 5060 MHz [12] (disabled)
* 5080 MHz [16] (disabled)
* 5170 MHz [34] (disabled)
* 5180 MHz [36] (20.0 dBm) (passive scanning, no
IBSS)
* 5190 MHz [38] (20.0 dBm) (passive scanning, no
IBSS)
* 5200 MHz [40] (20.0 dBm) (passive scanning, no
IBSS)
* 5210 MHz [42] (20.0 dBm) (passive scanning, no
IBSS)
* 5220 MHz [44] (20.0 dBm) (passive scanning, no
IBSS)
* 5230 MHz [46] (20.0 dBm) (passive scanning, no
IBSS)
* 5240 MHz [48] (20.0 dBm) (passive scanning, no
IBSS)
* 5260 MHz [52] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5280 MHz [56] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5300 MHz [60] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5320 MHz [64] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5500 MHz [100] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5520 MHz [104] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5540 MHz [108] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5560 MHz [112] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5580 MHz [116] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5600 MHz [120] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5620 MHz [124] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5640 MHz [128] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5660 MHz [132] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5680 MHz [136] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5700 MHz [140] (20.0 dBm) (passive scanning, no
IBSS, radar detection)
* 5745 MHz [149] (20.0 dBm) (passive scanning, no
IBSS)

Re: NetworkManager WiFi AP Mode

2016-06-07 Thread Dan Williams
On Tue, 2016-06-07 at 12:01 -0700, Ali Nematollahi wrote:
> wlan0: AP mode support not included in the build

Looks like your wifi driver doesn't support AP mode...  What does 'iw
phy phy0 info' say in the "Supported interface modes" section?

Dan
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager WiFi AP Mode

2016-06-07 Thread Ali Nematollahi
Hey Dan

Yup I forgot to start wpa_supplicant in my earlier logs but this time I did
it and I get pretty much the same thing, but with a little bit more
detailed logs...
root@beaglebone:~# NetworkManager --debug &
[2] 2902
root@beaglebone:~#
(NetworkManager:2902): NetworkManager-WARNING **:   glib-version:
cannot handle SIGUSR1 and SIGUSR2 signals. Consider upgrading glib to
2.36.0 or newer
NetworkManager[2902]:   NetworkManager (version 1.0.10) is starting...
NetworkManager[2902]:   Read config:
/etc/NetworkManager/NetworkManager.conf
NetworkManager[2902]:   init!
NetworkManager[2902]:   update_system_hostname
NetworkManager[2902]: interface-parser: parsing file
/etc/network/interfaces
NetworkManager[2902]: interface-parser: finished parsing file
/etc/network/interfaces
NetworkManager[2902]:   guessed connection type (eth0) =
802-3-ethernet
NetworkManager[2902]:   update_connection_setting_from_if_block:
name:eth0, type:802-3-ethernet, id:Ifupdown (eth0), uuid:
681b428f-beaf-8932-dce4-687ed5bae28e
NetworkManager[2902]:   adding eth0 to connections
NetworkManager[2902]:   adding iface eth0 to eni_ifaces
NetworkManager[2902]:   autoconnect
NetworkManager[2902]:   management mode: unmanaged
NetworkManager[2902]:   devices added (path:
/sys/devices/ocp.2/4781.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wl18xx.2.auto/net/wlan0,
iface: wlan0)
NetworkManager[2902]:   device added (path:
/sys/devices/ocp.2/4781.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wl18xx.2.auto/net/wlan0,
iface: wlan0): no ifupdown configuration found.
NetworkManager[2902]:   devices added (path:
/sys/devices/ocp.2/481cc000.d_can/net/can0, iface: can0)
NetworkManager[2902]:   device added (path:
/sys/devices/ocp.2/481cc000.d_can/net/can0, iface: can0): no ifupdown
configuration found.
NetworkManager[2902]:   devices added (path:
/sys/devices/ocp.2/481d.d_can/net/can1, iface: can1)
NetworkManager[2902]:   device added (path:
/sys/devices/ocp.2/481d.d_can/net/can1, iface: can1): no ifupdown
configuration found.
NetworkManager[2902]:   devices added (path:
/sys/devices/ocp.2/4a10.ethernet/net/eth0, iface: eth0)
NetworkManager[2902]:   locking wired connection setting
NetworkManager[2902]:   devices added (path:
/sys/devices/virtual/net/lo, iface: lo)
NetworkManager[2902]:   device added (path:
/sys/devices/virtual/net/lo, iface: lo): no ifupdown configuration found.
NetworkManager[2902]:   end _init.
NetworkManager[2902]:   Loaded settings plugin ifupdown: (C) 2008
Canonical Ltd.  To report bugs please use the NetworkManager mailing list.
(/usr/lib/NetworkManager/libnm-settings-plugin-ifupdown.so)
NetworkManager[2902]:   Loaded settings plugin keyfile: (c) 2007 -
2015 Red Hat, Inc.  To report bugs please use the NetworkManager mailing
list.
NetworkManager[2902]:   (1416752) ... get_connections.
NetworkManager[2902]:   (1416752) ... get_connections
(managed=false): return empty list.
NetworkManager[2902]:   keyfile: new connection
/etc/NetworkManager/system-connections/Hotspot
(3e13073d-6d7a-440d-ab2b-4f42c9fdacaf,"Hotspot")
NetworkManager[2902]:   keyfile: new connection
/etc/NetworkManager/system-connections/modem0
(084cef7e-d695-4677-bca8-8ac435c6f754,"modem0")
NetworkManager[2902]:   get unmanaged devices count: 1
NetworkManager[2902]:   monitoring kernel firmware directory
'/lib/firmware'.
NetworkManager[2902]:   rfkill0: found WiFi radio killswitch (at
/sys/devices/ocp.2/4781.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wl18xx.2.auto/ieee80211/phy0/rfkill0)
(driver wl18xx_driver)
NetworkManager[2902]:   WiFi hardware radio set enabled
NetworkManager[2902]:   WWAN hardware radio set enabled
NetworkManager[2902]:   Loaded device plugin: NMVxlanFactory
(internal)
NetworkManager[2902]:   Loaded device plugin: NMVlanFactory (internal)
NetworkManager[2902]:   Loaded device plugin: NMVethFactory (internal)
NetworkManager[2902]:   Loaded device plugin: NMTunFactory (internal)
NetworkManager[2902]:   Loaded device plugin: NMMacvlanFactory
(internal)
NetworkManager[2902]:   Loaded device plugin: NMInfinibandFactory
(internal)
NetworkManager[2902]:   Loaded device plugin: NMGreFactory (internal)
NetworkManager[2902]:   Loaded device plugin: NMEthernetFactory
(internal)
NetworkManager[2902]:   Loaded device plugin: NMBridgeFactory
(internal)
NetworkManager[2902]:   Loaded device plugin: NMBondFactory (internal)
NetworkManager[2902]:   Loaded device plugin: NMWifiFactory
(/usr/lib/NetworkManager/libnm-device-plugin-wifi.so)
NetworkManager[2902]:   (/libnm-device-plugin-bluetooth.so): failed
to load plugin: /usr/lib/NetworkManager/libnm-device-plugin-bluetooth.so:
undefined symbol: g_clear_pointer
NetworkManager[2902]:   Loaded device plugin: NMWwanFactory
(/usr/lib/NetworkManager/libnm-device-plugin-wwan.so)
NetworkManager[2902]:   Loaded device plugin: NMAtmManager
(/usr/lib/NetworkManager/libnm-device-plugin-adsl.so)
NetworkManager[2902]:   WiFi enabled by radio killswitch; enabled by
state file
NetworkManager[2902]:   WW

Re: nm-connection-editor forgets WPA password

2016-06-07 Thread Bastien Nocera
On Tue, 2016-06-07 at 19:29 +0200, Thomas Haller wrote:
> On Tue, 2016-06-07 at 19:10 +0200, Bastien Nocera wrote:
> > Hey,
> > 
> > I get problems when trying this with both nm-connection-editor and
> > gnome-control-center, so it's probably a problem in the common
> > code.
> > 
> > 1. Connect to a known wireless network with WPA/WPA2 Personal
> > authentication
> > 2. Once connected, edit the connection
> > 3. In "Wi-Fi Security" select "Dynamic WEP", then "Tunneled TLS" as
> > the
> > authentication, enter bogus values in "anonymous identity",
> > "username"
> > and password". Tick the "No CA certificate is required" checkbox.
> > 4. "nmcli connection down "
> > 5. "nmcli connection up " (you can press Ctrl+C when
> > you're bored)
> > 6. Re-edit the connection
> > 7. Select WPA/WPA Personal in "Wi-Fi Security", and put in the
> > actual
> > Wi-Fi password
> > 8. Run "nmcli connection up " again
> > 
> > "
> > Passwords or encryption keys are required to access the wireless
> > network 'test'.
> > Warning: password for '802-11-wireless-security.psk' not given in
> > 'passwd-file' and nmcli cannot ask without '--ask' option.
> > "
> > 
> > It will then ask for the password in a loop, and never allow
> > connection.
> > 
> > Ideas? Do you prefer this being filed in bugzilla?
> > 
> 
> 
> could this be
> https://git.gnome.org/browse/network-manager-applet/commit/?id=c21d56
> dd22057103c8125a49307b4ff47b5b644d

No, that's already in my tree. It asks for a password repeatedly, even
when it is correct. I think that NetworkManager might think it's a
different kind of connection compared to what nm-connection-editor
thinks.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NetworkManager WiFi AP Mode

2016-06-07 Thread Dan Williams
On Mon, 2016-06-06 at 15:06 -0700, Ali Nematollahi wrote:
> Hi Dan
> 
> Here are the outputs:
> 
> root@beaglebone:~# nmcli radio
> WIFI-HW  WIFI WWAN-HW  WWAN
> enabled  enabled  enabled  enabled
> 
> root@beaglebone:~# rfkill list
> 0: phy0: Wireless LAN
> Soft blocked: no
> Hard blocked: no

Ok, that's not the problem then...  In an earlier log you had:

NetworkManager[2845]:   (wlan0) supports 1 scan SSIDs
NetworkManager[2845]:   (wlan0): supplicant interface state:
starting -> ready
NetworkManager[2845]:   (wlan0): device state change: unavailable
-> disconnected (reason 'supplicant-available') [20 30 42]

Do you see that "unavailable -> disconnected" in the logs now?  When
the supplicant gets started, the device should  move to the
'disconnected' state (your latest logs here show the device in
'unavailable' state).  Can you make sure the supplicant is running
again?

Dan

> ifconfig
> eth0  Link encap:Ethernet  HWaddr ec:24:b8:cf:e0:be
>   UP BROADCAST MULTICAST  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>   Interrupt:56
> 
> loLink encap:Local Loopback
>   inet addr:127.0.0.1  Mask:255.0.0.0
>   UP LOOPBACK RUNNING  MTU:65536  Metric:1
>   RX packets:1 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:0
>   RX bytes:112 (112.0 B)  TX bytes:112 (112.0 B)
> 
> wlan0 Link encap:Ethernet  HWaddr 5c:31:3e:ce:be:5b
>   UP BROADCAST MULTICAST  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> 
> On Mon, Jun 6, 2016 at 2:28 PM, Dan Williams  wrote:
> 
> > 
> > On Mon, 2016-06-06 at 13:22 -0700, Ali Nematollahi wrote:
> > > 
> > > Hi Dan
> > > root@beaglebone:~# nmcli -f all dev show wlan0
> > > GENERAL.DEVICE: wlan0
> > > GENERAL.TYPE:   wifi
> > > GENERAL.NM-TYPE:NMDeviceWifi
> > > GENERAL.VENDOR:
> > > GENERAL.PRODUCT:
> > > GENERAL.DRIVER: wl18xx_driver
> > > GENERAL.DRIVER-VERSION: 3.12.10-svn34
> > > GENERAL.FIRMWARE-VERSION:   N/A
> > > GENERAL.HWADDR: 5C:31:3E:CE:BE:5B
> > > GENERAL.MTU:1500
> > > GENERAL.STATE:  20 (unavailable)
> > So here's why: the device is listed as unavailable.  Let's check
> > rfkill
> > to make sure NM isn't being told to put wlan0 into airplane mode:
> > 
> > nmcli radio
> > 
> > and you should see something like this:
> > 
> > WIFI-HW  WIFI WWAN-HW  WWAN
> > enabled  enabled  enabled  enabled
> > 
> > In this case, my WiFi is enabled; if one of those two is 'disabled'
> > for
> > you, then we can dig deeper into that.  Also, grab:
> > 
> > rfkill list
> > 
> > Dan
> > 
> > > 
> > > GENERAL.REASON: 2 (Device is now managed)
> > > GENERAL.UDI:
> > >  /sys/devices/ocp.2/4781.mmc/mmc_host/mmc2/mmc2:0001/mmc2:000
> > > 1:2/
> > > wl18xx.2.auto/net/wlan0
> > > GENERAL.IP-IFACE:
> > > GENERAL.IS-SOFTWARE:no
> > > GENERAL.NM-MANAGED: yes
> > > GENERAL.AUTOCONNECT:yes
> > > GENERAL.FIRMWARE-MISSING:   no
> > > GENERAL.PHYS-PORT-ID:   --
> > > GENERAL.CONNECTION: --
> > > GENERAL.CON-UUID:   --
> > > GENERAL.CON-PATH:   --
> > > GENERAL.METERED:unknown
> > > CAPABILITIES.CARRIER-DETECT:no
> > > CAPABILITIES.SPEED: unknown
> > > CAPABILITIES.IS-SOFTWARE:   no
> > > WIFI-PROPERTIES.WEP:yes
> > > WIFI-PROPERTIES.WPA:yes
> > > WIFI-PROPERTIES.WPA2:   yes
> > > WIFI-PROPERTIES.TKIP:   yes
> > > WIFI-PROPERTIES.CCMP:   yes
> > > WIFI-PROPERTIES.AP: yes
> > > WIFI-PROPERTIES.ADHOC:  yes
> > > WIFI-PROPERTIES.2GHZ:   yes
> > > WIFI-PROPERTIES.5GHZ:   yes
> > > CONNECTIONS.AVAILABLE-CONNECTION-PATHS:
> > > 
> > > nmcli con up Hotspot
> > > Error: Connection activation failed: No suitable device found for
> > > this
> > > connection.
> > > 
> > > 
> > > Thanks!
> > > 
> > > 
> > > On Mon, Jun 6, 2016 at 9:17 AM, Dan Williams 
> > > wrote:
> > > 
> > > > 
> > > > 
> > > > On Fri, 2016-06-03 at 13:49 -0700, Ali Nematollahi wrote:
> > > > > 
> > > > > 
> > > > > That was a great point Dan. It went one step forward:
> > > > > 
> > > > > 
>

Re: nm-connection-editor forgets WPA password

2016-06-07 Thread Thomas Haller
On Tue, 2016-06-07 at 19:10 +0200, Bastien Nocera wrote:
> Hey,
> 
> I get problems when trying this with both nm-connection-editor and
> gnome-control-center, so it's probably a problem in the common code.
> 
> 1. Connect to a known wireless network with WPA/WPA2 Personal
> authentication
> 2. Once connected, edit the connection
> 3. In "Wi-Fi Security" select "Dynamic WEP", then "Tunneled TLS" as
> the
> authentication, enter bogus values in "anonymous identity",
> "username"
> and password". Tick the "No CA certificate is required" checkbox.
> 4. "nmcli connection down "
> 5. "nmcli connection up " (you can press Ctrl+C when
> you're bored)
> 6. Re-edit the connection
> 7. Select WPA/WPA Personal in "Wi-Fi Security", and put in the actual
> Wi-Fi password
> 8. Run "nmcli connection up " again
> 
> "
> Passwords or encryption keys are required to access the wireless
> network 'test'.
> Warning: password for '802-11-wireless-security.psk' not given in
> 'passwd-file' and nmcli cannot ask without '--ask' option.
> "
> 
> It will then ask for the password in a loop, and never allow
> connection.
> 
> Ideas? Do you prefer this being filed in bugzilla?
> 


could this be
https://git.gnome.org/browse/network-manager-applet/commit/?id=c21d56dd22057103c8125a49307b4ff47b5b644d


Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM can't see WEP access point

2016-06-07 Thread Bastien Nocera
On Tue, 2016-06-07 at 09:58 -0500, Dan Williams wrote:
> On Tue, 2016-06-07 at 16:09 +0200, Bastien Nocera wrote:
> > Hey,
> > 
> > iwlist scan as root shows:
> >           Cell 17 - Address: 00:24:36:9D:3B:33
> > Channel:11
> > Frequency:2.462 GHz (Channel 11)
> > Quality=70/70  Signal level=-32 dBm  
> > Encryption key:on
> > ESSID:"WEP test"
> > Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6
> > Mb/s
> >   9 Mb/s; 12 Mb/s; 18 Mb/s
> > Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
> > Mode:Master
> > Extra:tsf=0069f3b5fd9a
> > Extra: Last beacon: 27430ms ago
> > IE: Unknown: 00085745502074657374
> > IE: Unknown: 010882848B960C121824
> > IE: Unknown: 03010B
> > IE: Unknown: 0706474220010D1E
> > IE: Unknown: 2A0100
> > IE: Unknown: 32043048606C
> > IE: IEEE 802.11i/WPA2 Version 1
> > Group Cipher : WEP-104
> > Pairwise Ciphers (2) : CCMP TKIP
> > Authentication Suites (1) : PSK
> > IE: Unknown:
> > 2D1A2C401700
> > IE: Unknown:
> > 3D160B001100
> > IE: Unknown: 4605020001
> > IE: WPA Version 1
> > Group Cipher : WEP-104
> > Pairwise Ciphers (1) : TKIP
> > Authentication Suites (1) : PSK
> > IE: Unknown:
> > DD180050F2020101070003A427A442435E0062322F00
> > IE: Unknown: DD07000393016B0B20
> > IE: Unknown: DD0E0017F207000101060024369D3B33
> > IE: Unknown: DD0B0017F2010001010007
> > 
> > Which is a WEP access point created on an Airport Express gen 1
> > device.
> > "nmcli -f all device wifi | grep 'WEP test'" doesn't show anything
> > related to that access point?
> > 
> > Any ideas on how to debug this?
> 
> It depends if the supplicant has actually exposed it via D-Bus yet
> too.
> 
> Grab http://people.redhat.com/dcbw/wpas-list.py and sudo-run that
> with
> the interface name of your wifi device, and see if the AP shows up in
> that list.  It directly dumps out the supplicant's AP list in a more
> readable form.

$ sudo ./wpas-list.py wlp2s0
[sudo] password for hadess: 
  54:64:d9:3e:0e:89  ::  ssid='Livebox-0E88'  wpa=yes  wpa2=yes  signal=-58%  
freq=5240
  18:1e:78:70:c4:6b  ::  ssid='Livebox-C46A'  wpa=yes  wpa2=yes  signal=-62%  
freq=5520
Traceback (most recent call last):
  File "./wpas-list.py", line 68, in 
main()
  File "./wpas-list.py", line 46, in main
props = props_iface.GetAll(WPAS_DBUS_BSSID_INTERFACE)
  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 70, in 
__call__
return self._proxy_method(*args, **keywords)
  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 145, in 
__call__
**keywords)
  File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 651, in 
call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Failed: failed to 
parse RSN IE

Ungood.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


nm-connection-editor forgets WPA password

2016-06-07 Thread Bastien Nocera
Hey,

I get problems when trying this with both nm-connection-editor and
gnome-control-center, so it's probably a problem in the common code.

1. Connect to a known wireless network with WPA/WPA2 Personal
authentication
2. Once connected, edit the connection
3. In "Wi-Fi Security" select "Dynamic WEP", then "Tunneled TLS" as the
authentication, enter bogus values in "anonymous identity", "username"
and password". Tick the "No CA certificate is required" checkbox.
4. "nmcli connection down "
5. "nmcli connection up " (you can press Ctrl+C when
you're bored)
6. Re-edit the connection
7. Select WPA/WPA Personal in "Wi-Fi Security", and put in the actual
Wi-Fi password
8. Run "nmcli connection up " again

"
Passwords or encryption keys are required to access the wireless
network 'test'.
Warning: password for '802-11-wireless-security.psk' not given in
'passwd-file' and nmcli cannot ask without '--ask' option.
"

It will then ask for the password in a loop, and never allow
connection.

Ideas? Do you prefer this being filed in bugzilla?

Cheers
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM can't see WEP access point

2016-06-07 Thread Dan Williams
On Tue, 2016-06-07 at 16:09 +0200, Bastien Nocera wrote:
> Hey,
> 
> iwlist scan as root shows:
>           Cell 17 - Address: 00:24:36:9D:3B:33
> Channel:11
> Frequency:2.462 GHz (Channel 11)
> Quality=70/70  Signal level=-32 dBm  
> Encryption key:on
> ESSID:"WEP test"
> Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6
> Mb/s
>   9 Mb/s; 12 Mb/s; 18 Mb/s
> Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
> Mode:Master
> Extra:tsf=0069f3b5fd9a
> Extra: Last beacon: 27430ms ago
> IE: Unknown: 00085745502074657374
> IE: Unknown: 010882848B960C121824
> IE: Unknown: 03010B
> IE: Unknown: 0706474220010D1E
> IE: Unknown: 2A0100
> IE: Unknown: 32043048606C
> IE: IEEE 802.11i/WPA2 Version 1
> Group Cipher : WEP-104
> Pairwise Ciphers (2) : CCMP TKIP
> Authentication Suites (1) : PSK
> IE: Unknown:
> 2D1A2C401700
> IE: Unknown:
> 3D160B001100
> IE: Unknown: 4605020001
> IE: WPA Version 1
> Group Cipher : WEP-104
> Pairwise Ciphers (1) : TKIP
> Authentication Suites (1) : PSK
> IE: Unknown:
> DD180050F2020101070003A427A442435E0062322F00
> IE: Unknown: DD07000393016B0B20
> IE: Unknown: DD0E0017F207000101060024369D3B33
> IE: Unknown: DD0B0017F2010001010007
> 
> Which is a WEP access point created on an Airport Express gen 1
> device.
> "nmcli -f all device wifi | grep 'WEP test'" doesn't show anything
> related to that access point?
> 
> Any ideas on how to debug this?

It depends if the supplicant has actually exposed it via D-Bus yet too.

Grab http://people.redhat.com/dcbw/wpas-list.py and sudo-run that with
the interface name of your wifi device, and see if the AP shows up in
that list.  It directly dumps out the supplicant's AP list in a more
readable form.  If the AP shows up there, but doesn't show up in
NetworkManager, then we need to enable NM debug logging including the
WIFI_SCAN log domain to see why it's not showing up in NM.

NM 1.2 and later ditch the internal AP list code and just present the
APs that the supplicant does, and remove them from the NM internal AP
list when the supplicant removes them from its own scan list.  So there
shouldn't be any real difference between NM's list and the supplicants,
unless NM failed to parse the supplicant D-Bus object for some reason.

Dan
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: backport everything from master to nm-1-2

2016-06-07 Thread Thomas Haller
On Tue, 2016-05-31 at 16:25 +0200, Thomas Haller wrote:
> Hi,
> 
> 
> all: merge branch 'master' into nm-1-2
> --
> 

ok, let's scratch this idea.
We leave nm-1-2 as is. Do backport important fixes as required (that
is, as somebody pro-actively) expresses the desire for a backport), and
just speed up the time for our new major releases. 1.4.0 should come
soon then.


best,
Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


NM can't see WEP access point

2016-06-07 Thread Bastien Nocera
Hey,

iwlist scan as root shows:
          Cell 17 - Address: 00:24:36:9D:3B:33
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=70/70  Signal level=-32 dBm  
Encryption key:on
ESSID:"WEP test"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
  9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0069f3b5fd9a
Extra: Last beacon: 27430ms ago
IE: Unknown: 00085745502074657374
IE: Unknown: 010882848B960C121824
IE: Unknown: 03010B
IE: Unknown: 0706474220010D1E
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : WEP-104
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: 
2D1A2C401700
IE: Unknown: 
3D160B001100
IE: Unknown: 4605020001
IE: WPA Version 1
Group Cipher : WEP-104
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: Unknown: 
DD180050F2020101070003A427A442435E0062322F00
IE: Unknown: DD07000393016B0B20
IE: Unknown: DD0E0017F207000101060024369D3B33
IE: Unknown: DD0B0017F2010001010007

Which is a WEP access point created on an Airport Express gen 1 device.
"nmcli -f all device wifi | grep 'WEP test'" doesn't show anything
related to that access point?

Any ideas on how to debug this?

NetworkManager-wifi-1.2.2-2.fc24.x86_64
NetworkManager-1.2.2-2.fc24.x86_64

kernel-4.7.0-0.rc0.git6.1.fc25.x86_64

Cheers
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH] connection-editor: Fix wired 802-1x secrets saving

2016-06-07 Thread Thomas Haller
On Thu, 2016-05-26 at 20:30 +0300, Mikhail Efremov wrote:
> In case of wired 802-1x connection a temporary connection object is
> used,
> but since NM commit 6a19e68a7d856629600655a076b0cea4be346799
> secrets are cleared when the object is destroyed.
> So duplicate 802-1x settings instead of using g_object_ref().
> ---
>  src/connection-editor/page-8021x-security.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/connection-editor/page-8021x-security.c
> b/src/connection-editor/page-8021x-security.c
> index 5af6111..afc4e88 100644
> --- a/src/connection-editor/page-8021x-security.c
> +++ b/src/connection-editor/page-8021x-security.c
> @@ -159,7 +159,7 @@ ce_page_validate_v (CEPage *page, NMConnection
> *connection, GError **error)
>   ws_802_1x_fill_connection (priv->security,
> "wpa_eap_auth_combo", tmp_connection);
>  
>   s_8021x = nm_connection_get_setting
> (tmp_connection, NM_TYPE_SETTING_802_1X);
> - nm_connection_add_setting (connection,
> NM_SETTING (g_object_ref (s_8021x)));
> + nm_connection_add_setting (connection,
> nm_setting_duplicate (s_8021x));
>  
>   g_object_unref (tmp_connection);
>   }


yeah, looks right.

merged to master:
https://git.gnome.org/browse/network-manager-applet/commit/?id=c21d56dd22057103c8125a49307b4ff47b5b644d


Thank you,
Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: pppd DNS update issue in NM 1.0.12

2016-06-07 Thread Samuel Casa
On Sun, May 29, 2016 at 3:14 PM, Thomas Haller  wrote:
> On Fri, 2016-05-27 at 09:59 +0200, Samuel Casa wrote:
>> On Mon, Apr 18, 2016 at 8:02 PM, Thomas Haller 
>> wrote:
>> >
>> The pppd connection is handled by the NM.
>> The problem with the connection setup seems to be related to the
>> 'secondaries' configuration element in the section 'connection'.
>> If I define the VPN connection as a 'secondary' for my Mobile0
>> configuration, the NM can not bring up the connection [1]
>>
>>   $ nmcli c up Mobile0
>>
>>
>> If I bring up the network connection from the command line without
>> 'secondaries' using
>>
>>   $ nmcli c up Mobile0
>>   $ nmcli c up VPN0
>>
>> everything works fine! DNS is set as expected for the mobile link and
>> the VPN connection comes up.
>>
>> How to debug this easiest way?
>> Thank you in advance!
>
> Hi Samuel,
>

Hi Thomas

>
> You can see that openvpn fails to resolve the name of your external
> gateway.
>   nm-openvpn[5674]: RESOLVE: Cannot resolve host address: vpn.host.com: 
> Temporary failure in name resolution
>
> As you are probably aware, setting a VPN connection as "secondaries" is
> similar to just activating both Mobile0 and VPN0 manually after each
> other.

There seems to be a timing issue on my system...
If I enable the DEBUG logging in the NM configuration file, the mobile
connection comes successfully up.
So it works if I bring the mobile connection up manually (without
secondaries configured) and with the DEBUG logging.

If i grep the NM log for 'state' changes, the output is quiet
interesting and as well strange for me.

state changes _without_ DEBUG logging, no connection establishment
(nmcli c up  Mobile0):
NetworkManager[]:   (ttyUSB3): device state change: disconnected
-> prepare (reason 'none') [30 40 0]
NetworkManager[]:   NetworkManager state is now CONNECTING
ModemManager[]:   Simple connect state (4/8): Wait to get fully enabled
ModemManager[]:   Simple connect state (5/8): Register
ModemManager[]:   Simple connect state (6/8): Bearer
ModemManager[]:   Simple connect state (7/8): Connect
ModemManager[]:   Modem /org/freedesktop/ModemManager1/Modem/0:
state changed (registered -> connecting)
NetworkManager[]:   (ttyUSB3): modem state changed, 'registered'
--> 'connecting' (reason: user-requested)
ModemManager[]:   Modem /org/freedesktop/ModemManager1/Modem/0:
state changed (connecting -> connected)
NetworkManager[]:   (ttyUSB3): modem state changed, 'connecting'
--> 'connected' (reason: user-requested)
ModemManager[]:   Simple connect state (8/8): All done
NetworkManager[]:   (ttyUSB3): device state change: prepare ->
config (reason 'none') [40 50 0]
NetworkManager[]:   (ttyUSB3): device state change: config ->
ip-config (reason 'none') [50 70 0]
NetworkManager[]:   (ppp0): device state change: unmanaged ->
unavailable (reason 'connection-assumed') [10 20 41]
NetworkManager[]:   (ppp0): device state change: unavailable ->
disconnected (reason 'connection-assumed') [20 30 41]
NetworkManager[]:   (ppp0): device state change: disconnected ->
prepare (reason 'none') [30 40 0]
NetworkManager[]:   (ttyUSB3): device state change: ip-config ->
ip-check (reason 'none') [70 80 0]
NetworkManager[]:   (ppp0): device state change: prepare ->
config (reason 'none') [40 50 0]
NetworkManager[]:   (ppp0): device state change: config ->
ip-config (reason 'none') [50 70 0]
NetworkManager[]:   (ttyUSB3): device state change: ip-check ->
secondaries (reason 'none') [80 90 0]
NetworkManager[]:   (ppp0): device state change: ip-config ->
ip-check (reason 'none') [70 80 0]
NetworkManager[]:   (ppp0): device state change: ip-check ->
secondaries (reason 'none') [80 90 0]
NetworkManager[]:   VPN plugin state changed: starting (3)
NetworkManager[]:   (ttyUSB3): device state change: secondaries
-> failed (reason 'secondary-connection-failed') [90 120 54]
NetworkManager[]:   NetworkManager state is now CONNECTED_LOCAL
ModemManager[]:   Modem /org/freedesktop/ModemManager1/Modem/0:
state changed (connected -> disconnecting)
NetworkManager[]:   (ttyUSB3): modem state changed, 'connected'
--> 'disconnecting' (reason: user-requested)
NetworkManager[]:   (ttyUSB3): device state change: failed ->
disconnected (reason 'none') [120 30 0]
ModemManager[]:   Modem /org/freedesktop/ModemManager1/Modem/0:
state changed (disconnecting -> registered)
NetworkManager[]:   (ttyUSB3): modem state changed,
'disconnecting' --> 'registered' (reason: user-requested)

state changes _with_ DEBUG logging, connection establishment (nmcli c
up  Mobile0):
NetworkManager[]:   (ttyUSB3): device state change: disconnected
-> prepare (reason 'none') [30 40 0]
NetworkManager[]:  [1465288862.903379]
[NetworkManager-1.0.12/src/nm-connectivity.c:108] update_state():
connectivity: state changed from FULL to NONE
NetworkManager[]:   NetworkManager state is now CONNECTING
ModemManager[]:   Simple connect state (4/8): Wait to get fully enabled
ModemManager[]:   Simple connect state (5/8): Register
ModemManager[]:   Simpl

Re: [PATCH 2/2] device: add statistics interface

2016-06-07 Thread Thomas Haller
On Fri, 2016-06-03 at 18:44 +0200, Alfonso Sanchez-Beato wrote:
> Add statistics interface to all device instances. When active, the
> properties of this interface are refreshed whenever there is network
> activity for the device.
> 
> Activation is performed by changing RefreshRateMs property. If set to
> zero, the interface is deactivated. If set to other value, the rest
> of
> the interface properties are refreshed whenever the related network
> metric changes, being RefreshRateMs the minimum time between property
> changes, in milliseconds.


Overall, this looks very good to me.


> ---
>  introspection/Makefile.am  |   6 +-
>  introspection/nm-device-statistics.xml |  43 
>  libnm-core/nm-dbus-interface.h |   1 +
>  src/Makefile.am|   2 +
>  src/devices/nm-device-private.h|   3 +
>  src/devices/nm-device-statistics.c | 407
> +
>  src/devices/nm-device-statistics.h |  33 +++
>  src/devices/nm-device.c| 102 -
>  src/devices/nm-device.h|   4 +
>  src/nm-types.h |   1 +
>  10 files changed, 600 insertions(+), 2 deletions(-)
>  create mode 100644 introspection/nm-device-statistics.xml
>  create mode 100644 src/devices/nm-device-statistics.c
>  create mode 100644 src/devices/nm-device-statistics.h
> 
> diff --git a/introspection/Makefile.am b/introspection/Makefile.am
> index 3a62793..f72703d 100644
> --- a/introspection/Makefile.am
> +++ b/introspection/Makefile.am
> @@ -41,6 +41,8 @@ nodist_libnmdbus_la_SOURCES = \
>   nmdbus-device-modem.h \
>   nmdbus-device-olpc-mesh.c \
>   nmdbus-device-olpc-mesh.h \
> + nmdbus-device-statistics.c \
> + nmdbus-device-statistics.h \
>   nmdbus-device-team.c \
>   nmdbus-device-team.h \
>   nmdbus-device-tun.c \
> @@ -111,7 +113,8 @@ DBUS_INTERFACE_DOCS = \
>   nmdbus-device-veth-
> org.freedesktop.NetworkManager.Device.Veth.xml \
>   nmdbus-settings-org.freedesktop.NetworkManager.Settings.xml
> \
>   nmdbus-device-ethernet-
> org.freedesktop.NetworkManager.Device.Wired.xml \
> - nmdbus-ip4-config-
> org.freedesktop.NetworkManager.IP4Config.xml
> + nmdbus-ip4-config-
> org.freedesktop.NetworkManager.IP4Config.xml \
> + nmdbus-device-statistics-
> org.freedesktop.NetworkManager.Device.Statistics.xml
>  
>  define _make_nmdbus_rule
>  $(1): $(patsubst nmdbus-%.c,nm-%.xml,$(1))
> @@ -150,6 +153,7 @@ EXTRA_DIST = \
>   nm-device-macvlan.xml \
>   nm-device-modem.xml \
>   nm-device-olpc-mesh.xml \
> + nm-device-statistics.xml \
>   nm-device-team.xml \
>   nm-device-tun.xml \
>   nm-device-veth.xml \
> diff --git a/introspection/nm-device-statistics.xml
> b/introspection/nm-device-statistics.xml
> new file mode 100644
> index 000..08a700e
> --- /dev/null
> +++ b/introspection/nm-device-statistics.xml
> @@ -0,0 +1,43 @@
> +
> +
> +   name="org.freedesktop.NetworkManager.Device.Statistics">
> +
> +
> +


as the property is readwrite, I think we need to check permissions.
See how that is done here:
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/nm-manager.c?id=24430e4b07b4c8c902adbbbf190ead43b1e92115#n4831




> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +  
> +
> diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-
> interface.h
> index 1e0fbe6..20eccb8 100644
> --- a/libnm-core/nm-dbus-interface.h
> +++ b/libnm-core/nm-dbus-interface.h
> @@ -68,6 +68,7 @@
>  #define NM_DBUS_INTERFACE_DEVICE_VXLAN  NM_DBUS_INTERFACE_DEVICE
> ".Vxlan"
>  #define NM_DBUS_INTERFACE_DEVICE_GRENM_DBUS_INTERFACE_DEVICE
> ".Gre"
>  #define NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL  NM_DBUS_INTERFACE_DEVICE
> ".IPTunnel"
> +#define NM_DBUS_INTERFACE_DEVICE_STATISTICS NM_DBUS_INTERFACE_DEVICE
> ".Statistics"
>  
>  #define
> NM_DBUS_INTERFACE_SETTINGS"org.freedesktop.NetworkManager.Set
> tings"
>  #define
> NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Se
> ttings"
> diff --git a/src/Makefile.am b/src/Makefile.am
> index e61e5aa..d9c8eba 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -289,6 +289,8 @@ libNetworkManager_la_SOURCES = \
>   devices/nm-device-generic.h \
>   devices/nm-device-logging.h \
>   devices/nm-device-private.h \
> + devices/nm-device-statistics.c \
> + devices/nm-device-statistics.h \
>   \
>   dhcp-manager/nm-dhcp-client.c \
>   dhcp-manager/nm-dhcp-client.h \
> diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-
> private.h
> index 418ae2d..addeda0 100644
> --- a/src/devices/nm-device-private.h
> +++ b/src/devices/nm-device-private.h
> @@ -111,6 +111,9 @@ void nm_device_ip_method_failed (NMDevice *self,
> int family, NMDeviceStateReason
>  
>  gboolean nm_device_ipv6_sysctl_set (NMDevice *self, const char
> *property, const char *value);
>  
> +void nm_device_se