~ubuntu-branches/ubuntu/trusty/libsnmp-info-perl/trusty

« back to all changes in this revision

Viewing changes to Info/Layer3.pm

  • Committer: Package Import Robot
  • Author(s): Nuno Carvalho
  • Date: 2012-07-30 22:08:17 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120730220817-bjnr7f6ztu67vnic
Tags: 2.08-1
* Team upload.
* d/control: Update Standards-Version to 3.9.3.
* d/copyright: Update URI for copyright format.
* d/copyright: Update copyright years and add new copyright holders.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
53
53
 
54
 
$VERSION = '2.06';
 
54
$VERSION = '2.08';
55
55
 
56
56
%MIBS = (
57
57
    %SNMP::Info::MIBS,
163
163
    my $router_ip = $l3->router_ip();
164
164
    my $ospf_ip   = $l3->ospf_ip();
165
165
 
 
166
    # if the router ip exists and is a route advertised by the device we prefer
 
167
    # it over the others
 
168
    return $router_ip
 
169
        if (( defined $router_ip )
 
170
        and ( $router_ip ne '0.0.0.0' )
 
171
        and ( grep { $ospf_ip->{$_} eq $router_ip } (keys %$ospf_ip))
 
172
        and ( $l3->snmp_connect_ip($router_ip) ) );
 
173
 
166
174
    # return the first one found here (should be only one)
167
175
    if ( defined $ospf_ip and scalar( keys %$ospf_ip ) ) {
168
176
        foreach my $key ( keys %$ospf_ip ) {
174
182
        }
175
183
    }
176
184
 
177
 
    return $router_ip
178
 
        if (( defined $router_ip )
179
 
        and ( $router_ip ne '0.0.0.0' )
180
 
        and ( $l3->snmp_connect_ip($router_ip) ) );
181
185
    return;
182
186
}
183
187