Add net_interface_config.description

This commit is contained in:
Doug MacEachern 2006-03-04 22:28:09 +00:00
parent 8cc89cd367
commit 81a29ba2a2
8 changed files with 29 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2006-03-04 Doug MacEachern <dougm@hyperic.net> 2006-03-04 Doug MacEachern <dougm@hyperic.net>
* Add net_interface_config.description
* Use IFMIB (GetIfEntry) rather netbios to get hwaddr on Win32 * Use IFMIB (GetIfEntry) rather netbios to get hwaddr on Win32
* Add net_interface_config.mtu for Win32 * Add net_interface_config.mtu for Win32

View File

@ -680,6 +680,11 @@ my %classes = (
desc => '', desc => '',
plat => '*' plat => '*'
}, },
{
name => 'description', type => 'String',
desc => '',
plat => '*'
},
{ {
name => 'address', type => 'NetAddr', name => 'address', type => 'NetAddr',
desc => '', desc => '',

View File

@ -75,6 +75,10 @@ public class Ifconfig extends SigarCommandBase {
hwaddr = " HWaddr " + ifconfig.getHwaddr(); hwaddr = " HWaddr " + ifconfig.getHwaddr();
} }
if (!ifconfig.getName().equals(ifconfig.getDescription())) {
println(ifconfig.getDescription());
}
println(ifconfig.getName() + "\t" + println(ifconfig.getName() + "\t" +
"Link encap:" + ifconfig.getType() + "Link encap:" + ifconfig.getType() +
hwaddr); hwaddr);

View File

@ -459,6 +459,7 @@ typedef struct {
char name[16]; char name[16];
char hwaddr[64]; char hwaddr[64];
char type[64]; char type[64];
char description[256];
sigar_uint64_t sigar_uint64_t
address, address,
destination, destination,

View File

@ -1798,6 +1798,10 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
close(sock); close(sock);
/* XXX can we get a better description like win32? */
SIGAR_SSTRCPY(ifconfig->description,
ifconfig->name);
return SIGAR_OK; return SIGAR_OK;
} }

View File

@ -1985,6 +1985,9 @@ int sigar_get_ifentry_config(sigar_t *sigar,
sigar_hwaddr_format(ifconfig->hwaddr, sigar_hwaddr_format(ifconfig->hwaddr,
ifr->bPhysAddr); ifr->bPhysAddr);
SIGAR_SSTRCPY(ifconfig->description,
ifr->bDescr);
return SIGAR_OK; return SIGAR_OK;
} }

View File

@ -1306,6 +1306,10 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
close(sock); close(sock);
/* XXX can we get a better description like win32? */
SIGAR_SSTRCPY(ifconfig->description,
ifconfig->name);
return SIGAR_OK; return SIGAR_OK;
} }

View File

@ -250,6 +250,12 @@ sigar_net_interface_config_get(sigar_t *sigar,
SIGAR_NIC_ETHERNET); SIGAR_NIC_ETHERNET);
} }
/* should be overridden w/ better description
* using MIB_IFROW.bDescr when hwaddr is lookedup
*/
SIGAR_SSTRCPY(ifconfig->description,
ifconfig->name);
hwaddr_lookup(sigar, ifconfig, i); hwaddr_lookup(sigar, ifconfig, i);
if (flags & IFF_POINTTOPOINT) { if (flags & IFF_POINTTOPOINT) {