diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-11-30 01:17:42 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-11-30 01:17:42 +0100 |
commit | 987ecf732ae21efd9e62faea265245492a15723e (patch) | |
tree | aea5cd66313cf461feb31a3cf307e9568c70c9da /src | |
parent | 8cb219bfdc0ae3763e19a0f96511f32f9b06e243 (diff) | |
download | connman-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.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; } } } |