void __connman_service_set_passphrase(struct connman_service *service,
const char* passphrase);
-void __connman_service_notify(struct connman_ipconfig *ipconfig,
+void __connman_service_notify(struct connman_service *service,
unsigned int rx_packets, unsigned int tx_packets,
unsigned int rx_bytes, unsigned int tx_bytes,
unsigned int rx_error, unsigned int tx_error,
static void update_stats(struct connman_ipdevice *ipdevice,
struct rtnl_link_stats *stats)
{
+ struct connman_service *service;
+
if (stats->rx_packets == 0 && stats->tx_packets == 0)
return;
if (ipdevice->config == NULL)
return;
+ service = connman_ipconfig_get_data(ipdevice->config);
+ if (service == NULL)
+ return;
+
ipdevice->rx_packets = stats->rx_packets;
ipdevice->tx_packets = stats->tx_packets;
ipdevice->rx_bytes = stats->rx_bytes;
ipdevice->rx_dropped = stats->rx_dropped;
ipdevice->tx_dropped = stats->tx_dropped;
- __connman_service_notify(ipdevice->config,
+ __connman_service_notify(service,
ipdevice->rx_packets, ipdevice->tx_packets,
ipdevice->rx_bytes, ipdevice->tx_bytes,
ipdevice->rx_errors, ipdevice->tx_errors,
stats->data.time = stats->data_last.time + seconds;
}
-void __connman_service_notify(struct connman_ipconfig *ipconfig,
+void __connman_service_notify(struct connman_service *service,
unsigned int rx_packets, unsigned int tx_packets,
unsigned int rx_bytes, unsigned int tx_bytes,
unsigned int rx_errors, unsigned int tx_errors,
unsigned int rx_dropped, unsigned int tx_dropped)
{
- struct connman_service *service;
GHashTableIter iter;
gpointer key, value;
const char *counter;
struct connman_stats_data *data;
int err;
- service = connman_ipconfig_get_data(ipconfig);
if (service == NULL)
return;