Merge commit 'mdkent/SIGAR-173'
This commit is contained in:
commit
f69a3c10e5
|
@ -1081,6 +1081,11 @@ use vars qw(%classes %cmds);
|
||||||
desc => '',
|
desc => '',
|
||||||
plat => 'DFL'
|
plat => 'DFL'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name => 'tx_queue_len', type => 'Int',
|
||||||
|
desc => '',
|
||||||
|
plat => 'L'
|
||||||
|
},
|
||||||
],
|
],
|
||||||
NetInterfaceStat => [
|
NetInterfaceStat => [
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,8 @@ iflist.each do |ifname|
|
||||||
" overruns:" + ifstat.tx_overruns.to_s +
|
" overruns:" + ifstat.tx_overruns.to_s +
|
||||||
" carrier:" + ifstat.tx_carrier.to_s
|
" carrier:" + ifstat.tx_carrier.to_s
|
||||||
|
|
||||||
puts "\t" + "collisions:" + ifstat.tx_collisions.to_s
|
puts "\t" + "collisions:" + ifstat.tx_collisions.to_s +
|
||||||
|
" txqueuelen:" + ifconfig.tx_queue_len.to_s
|
||||||
|
|
||||||
rx_bytes = ifstat.rx_bytes
|
rx_bytes = ifstat.rx_bytes
|
||||||
tx_bytes = ifstat.tx_bytes
|
tx_bytes = ifstat.tx_bytes
|
||||||
|
|
|
@ -614,6 +614,7 @@ typedef struct {
|
||||||
flags,
|
flags,
|
||||||
mtu,
|
mtu,
|
||||||
metric;
|
metric;
|
||||||
|
int tx_queue_len;
|
||||||
} sigar_net_interface_config_t;
|
} sigar_net_interface_config_t;
|
||||||
|
|
||||||
SIGAR_DECLARE(int)
|
SIGAR_DECLARE(int)
|
||||||
|
|
13
src/sigar.c
13
src/sigar.c
|
@ -1647,7 +1647,18 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
|
||||||
ifconfig->metric = ifr.ifr_metric ? ifr.ifr_metric : 1;
|
ifconfig->metric = ifr.ifr_metric ? ifr.ifr_metric : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(sock);
|
#if defined(SIOCGIFTXQLEN)
|
||||||
|
if (!ioctl(sock, SIOCGIFTXQLEN, &ifr)) {
|
||||||
|
ifconfig->tx_queue_len = ifr.ifr_qlen;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ifconfig->tx_queue_len = -1; /* net-tools behaviour */
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ifconfig->tx_queue_len = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
close(sock);
|
||||||
|
|
||||||
/* XXX can we get a better description like win32? */
|
/* XXX can we get a better description like win32? */
|
||||||
SIGAR_SSTRCPY(ifconfig->description,
|
SIGAR_SSTRCPY(ifconfig->description,
|
||||||
|
|
Loading…
Reference in New Issue