"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Ocsinventory/Agent/Backend/OS/BSD/Networks.pm" between
Ocsinventory-Unix-Agent-2.8.0.tar.gz and Ocsinventory-Unix-Agent-2.8.1.tar.gz

About: Ocsinventory-Agent is a Linux agent for OCS Inventory NG.

Networks.pm  (Ocsinventory-Unix-Agent-2.8.0):Networks.pm  (Ocsinventory-Unix-Agent-2.8.1)
skipping to change at line 155 skipping to change at line 155
TYPE => $type, TYPE => $type,
}); });
# Set default gateway in hardware info # Set default gateway in hardware info
$common->setHardware({ $common->setHardware({
DEFAULTGATEWAY => getRoute($ipaddress6) DEFAULTGATEWAY => getRoute($ipaddress6)
}); });
} }
} }
} }
1;
sub getSpeed{ sub getSpeed{
my ($speed)=@_; my ($speed)=@_;
return unless $speed; return unless $speed;
if ($speed gt 100 ){ if ($speed gt 100 ){
$speed = ($speed/1000)." Gbps"; $speed = ($speed/1000)." Gbps";
} else { } else {
$speed = $speed." Mbps"; $speed = $speed." Mbps";
} }
skipping to change at line 224 skipping to change at line 222
$route = $1 if /^default\s+(\S+)/i; $route = $1 if /^default\s+(\S+)/i;
} }
} elsif (ip_is_ipv6($prefix)) { } elsif (ip_is_ipv6($prefix)) {
for (`netstat -rn -f inet6`){ for (`netstat -rn -f inet6`){
$route = $1 if /^default\s+(\S+)/i; $route = $1 if /^default\s+(\S+)/i;
} }
} }
return $route; return $route;
} }
1;
__END__
=head1 NAME =head1 NAME
OCSInventory::Agent::Backend::OS::BSD::Networks - Network-related informations OCSInventory::Agent::Backend::OS::BSD::Networks - Network-related information
=head1 DESCRIPTION =head1 DESCRIPTION
This module retrieves network informations. This module retrieves network information.
=head1 FUNCTIONS =head1 FUNCTIONS
=head2 getSpeed =head2 getSpeed
Returns the speed of the card. Returns the speed of the card.
=head2 getRoute =head2 getRoute
Returns the gateway Returns the gateway
=back
=head2 getIPNetmaskV4 =head2 getIPNetmaskV4
Returns the IP v4 network mask Returns the IP v4 network mask
=back
=head2 getIPNetmaskV6 =head2 getIPNetmaskV6
Returns the IP v6 network mask Returns the IP v6 network mask
=back
=head2 getSubnetAddressIPv4 =head2 getSubnetAddressIPv4
Returns the subnet of ip v4 network Returns the subnet of ip v4 network
=back =head2 getSubnetAddressIPv6
=head getSubnetAddressIPv6
Returns the subnet of ip v6 network Returns the subnet of ip v6 network
=back
 End of changes. 9 change blocks. 
13 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)