use sigar_net_interface_flags_to_string

This commit is contained in:
Doug MacEachern 2007-09-03 03:00:49 +00:00
parent c204b5ccda
commit bcbf080fe9
2 changed files with 13 additions and 43 deletions

View File

@ -44,48 +44,5 @@ sub IFF_ALLMULTI() { 0x200 }
sub IFF_MULTICAST() { 0x800 }
sub net_interface_flags_string {
my($flags) = @_;
my $retval = "";
if ($flags == 0) {
$retval .= "[NO FLAGS] ";
}
if ($flags & IFF_UP) {
$retval .= "UP ";
}
if ($flags & IFF_BROADCAST) {
$retval .= "BROADCAST ";
}
if ($flags & IFF_DEBUG) {
$retval .= "DEBUG ";
}
if ($flags & IFF_LOOPBACK) {
$retval .= "LOOPBACK ";
}
if ($flags & IFF_POINTOPOINT) {
$retval .= "POINTOPOINT ";
}
if ($flags & IFF_NOTRAILERS) {
$retval .= "NOTRAILERS ";
}
if ($flags & IFF_RUNNING) {
$retval .= "RUNNING ";
}
if ($flags & IFF_NOARP) {
$retval .= "NOARP ";
}
if ($flags & IFF_PROMISC) {
$retval .= "PROMISC ";
}
if ($flags & IFF_ALLMULTI) {
$retval .= "ALLMULTI ";
}
if ($flags & IFF_MULTICAST) {
$retval .= "MULTICAST ";
}
return $retval;
}
1;
__END__

View File

@ -160,6 +160,19 @@ format_size(size)
OUTPUT:
RETVAL
char *
net_interface_flags_string(size)
UV size
PREINIT:
char buffer[1024];
CODE:
RETVAL = sigar_net_interface_flags_to_string(size, buffer);
OUTPUT:
RETVAL
char *
sigar_fqdn(sigar)
Sigar sigar