summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-11-30 01:17:42 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-11-30 01:17:42 +0100
commit987ecf732ae21efd9e62faea265245492a15723e (patch)
treeaea5cd66313cf461feb31a3cf307e9568c70c9da /src
parent8cb219bfdc0ae3763e19a0f96511f32f9b06e243 (diff)
downloadconnman-987ecf732ae21efd9e62faea265245492a15723e.tar.gz
connman-987ecf732ae21efd9e62faea265245492a15723e.tar.bz2
connman-987ecf732ae21efd9e62faea265245492a15723e.zip
Print some details of the interface statistics
Diffstat (limited to 'src')
-rw-r--r--src/rtnl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index 6d2efa24..455a2599 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -242,6 +242,7 @@ static const char *operstate2str(unsigned char operstate)
static void extract_link(struct ifinfomsg *msg, int bytes,
const char **ifname, unsigned char *operstate)
{
+ struct rtnl_link_stats stats;
struct rtattr *attr;
for (attr = IFLA_RTA(msg); RTA_OK(attr, bytes);
@@ -257,6 +258,14 @@ static void extract_link(struct ifinfomsg *msg, int bytes,
break;
case IFLA_LINKMODE:
break;
+ case IFLA_STATS:
+ memcpy(&stats, RTA_DATA(attr),
+ sizeof(struct rtnl_link_stats));
+ connman_info("%s {RX} %d packets %d bytes", *ifname,
+ stats.rx_packets, stats.rx_bytes);
+ connman_info("%s {TX} %d packets %d bytes", *ifname,
+ stats.tx_packets, stats.tx_bytes);
+ break;
}
}
}