line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SNMP::Mixin::IpRouteTable; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
223586
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
102
|
|
4
|
4
|
|
|
4
|
|
15
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
131
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# store this package name in a handy variable, |
8
|
|
|
|
|
|
|
# used for unambiguous prefix of mixin attributes |
9
|
|
|
|
|
|
|
# storage in object hash |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
my $prefix = __PACKAGE__; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# this module import config |
15
|
|
|
|
|
|
|
# |
16
|
4
|
|
|
4
|
|
15
|
use Carp (); |
|
4
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
77
|
|
17
|
4
|
|
|
4
|
|
1002
|
use Net::SNMP qw/oid_lex_sort/; |
|
4
|
|
|
|
|
57403
|
|
|
4
|
|
|
|
|
403
|
|
18
|
4
|
|
|
4
|
|
560
|
use Net::SNMP::Mixin::Util qw/idx2val push_error get_init_slot/; |
|
4
|
|
|
|
|
8297
|
|
|
4
|
|
|
|
|
24
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
# this module export config |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
my @mixin_methods; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
BEGIN { |
26
|
4
|
|
|
4
|
|
1228
|
@mixin_methods = (qw/ get_ip_route_table /); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
31
|
use Sub::Exporter -setup => { |
30
|
|
|
|
|
|
|
exports => [@mixin_methods], |
31
|
|
|
|
|
|
|
groups => { default => [@mixin_methods], }, |
32
|
4
|
|
|
4
|
|
20
|
}; |
|
4
|
|
|
|
|
4
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# |
35
|
|
|
|
|
|
|
# SNMP oid constants used in this module |
36
|
|
|
|
|
|
|
# |
37
|
|
|
|
|
|
|
# from mib-II |
38
|
|
|
|
|
|
|
use constant { |
39
|
4
|
|
|
|
|
1734
|
IP_ROUTE_TABLE => '1.3.6.1.2.1.4.21', |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
IP_ROUTE_DEST => '1.3.6.1.2.1.4.21.1.1', |
42
|
|
|
|
|
|
|
IP_ROUTE_IFINDEX => '1.3.6.1.2.1.4.21.1.2', |
43
|
|
|
|
|
|
|
IP_ROUTE_METRIC1 => '1.3.6.1.2.1.4.21.1.3', |
44
|
|
|
|
|
|
|
IP_ROUTE_METRIC2 => '1.3.6.1.2.1.4.21.1.4', |
45
|
|
|
|
|
|
|
IP_ROUTE_METRIC3 => '1.3.6.1.2.1.4.21.1.5', |
46
|
|
|
|
|
|
|
IP_ROUTE_METRIC4 => '1.3.6.1.2.1.4.21.1.6', |
47
|
|
|
|
|
|
|
IP_ROUTE_NEXTHOP => '1.3.6.1.2.1.4.21.1.7', |
48
|
|
|
|
|
|
|
IP_ROUTE_TYPE => '1.3.6.1.2.1.4.21.1.8', |
49
|
|
|
|
|
|
|
IP_ROUTE_PROTO => '1.3.6.1.2.1.4.21.1.9', |
50
|
|
|
|
|
|
|
IP_ROUTE_AGE => '1.3.6.1.2.1.4.21.1.10', |
51
|
|
|
|
|
|
|
IP_ROUTE_MASK => '1.3.6.1.2.1.4.21.1.11', |
52
|
|
|
|
|
|
|
IP_ROUTE_METRIC5 => '1.3.6.1.2.1.4.21.1.12', |
53
|
|
|
|
|
|
|
IP_ROUTE_INFO => '1.3.6.1.2.1.4.21.1.13', |
54
|
4
|
|
|
4
|
|
1118
|
}; |
|
4
|
|
|
|
|
4
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# |
57
|
|
|
|
|
|
|
# the ipRouteType enum |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
my %ip_route_type_enum = ( |
60
|
|
|
|
|
|
|
1 => 'other', |
61
|
|
|
|
|
|
|
2 => 'invalid', |
62
|
|
|
|
|
|
|
3 => 'direct', |
63
|
|
|
|
|
|
|
4 => 'indirect', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# |
67
|
|
|
|
|
|
|
# the ipRouteProto enum |
68
|
|
|
|
|
|
|
# |
69
|
|
|
|
|
|
|
my %ip_route_proto_enum = ( |
70
|
|
|
|
|
|
|
1 => 'other', |
71
|
|
|
|
|
|
|
2 => 'local', |
72
|
|
|
|
|
|
|
3 => 'netmgmt', |
73
|
|
|
|
|
|
|
4 => 'icmp', |
74
|
|
|
|
|
|
|
5 => 'egp', |
75
|
|
|
|
|
|
|
6 => 'ggp', |
76
|
|
|
|
|
|
|
7 => 'hello', |
77
|
|
|
|
|
|
|
8 => 'rip', |
78
|
|
|
|
|
|
|
9 => 'is-is', |
79
|
|
|
|
|
|
|
10 => 'es-is', |
80
|
|
|
|
|
|
|
11 => 'ciscoIgrp', |
81
|
|
|
|
|
|
|
12 => 'bbnSpfIgp', |
82
|
|
|
|
|
|
|
13 => 'ospf', |
83
|
|
|
|
|
|
|
14 => 'bgp', |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 NAME |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Net::SNMP::Mixin::IpRouteTable - mixin class for the mib-II ipRouteTable |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 VERSION |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Version 0.04 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 SYNOPSIS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
use Net::SNMP; |
101
|
|
|
|
|
|
|
use Net::SNMP::Mixin; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
#... |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
my $session = Net::SNMP->session( -hostname => 'foo.bar.com' ); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
$session->mixer('Net::SNMP::Mixin::IpRouteTable'); |
108
|
|
|
|
|
|
|
$session->init_mixins; |
109
|
|
|
|
|
|
|
snmp_dispatcher(); |
110
|
|
|
|
|
|
|
$session->init_ok(); |
111
|
|
|
|
|
|
|
die $session->errors if $session->errors; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
my @routes = get_ip_route_table(); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
foreach my $route ( @routes ) { |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
my $dest = $route->{ipRouteDest}; |
118
|
|
|
|
|
|
|
my $mask = $route->{ipRouteMask}; |
119
|
|
|
|
|
|
|
my $nhop = $route->{ipRouteNextHop}; |
120
|
|
|
|
|
|
|
my $proto_str = $route->{ipRouteProtoString}; |
121
|
|
|
|
|
|
|
my $type_str = $route->{ipRouteTypeString}; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
print "$dest/$mask => $nhop $proto_str $type_str\n"; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 DESCRIPTION |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
A Net::SNMP mixin class for mib-II ipRouteTable info. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 MIXIN METHODS |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 B<< OBJ->get_ip_route_table() >> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Returns the mib-II ipRouteTable as a list. Every route entry is a reference to a hash with the following fields and values: |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
ipRouteDest => IpAddress, |
138
|
|
|
|
|
|
|
ipRouteMask => IpAddress, |
139
|
|
|
|
|
|
|
ipRouteNextHop => IpAddress, |
140
|
|
|
|
|
|
|
ipRouteIfIndex => INTEGER, |
141
|
|
|
|
|
|
|
ipRouteMetric1 => INTEGER, |
142
|
|
|
|
|
|
|
ipRouteMetric2 => INTEGER, |
143
|
|
|
|
|
|
|
ipRouteMetric3 => INTEGER, |
144
|
|
|
|
|
|
|
ipRouteMetric4 => INTEGER, |
145
|
|
|
|
|
|
|
ipRouteMetric5 => INTEGER, |
146
|
|
|
|
|
|
|
ipRouteType => INTEGER, |
147
|
|
|
|
|
|
|
ipRouteTypeString => String, # resolved enum |
148
|
|
|
|
|
|
|
ipRouteProto => INTEGER, |
149
|
|
|
|
|
|
|
ipRouteTypeProto => String, # resolved enum |
150
|
|
|
|
|
|
|
ipRouteAge => INTEGER, |
151
|
|
|
|
|
|
|
ipRouteInfo => OBJECT IDENTIFIER |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=cut |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
sub get_ip_route_table { |
157
|
1
|
|
|
1
|
1
|
21047
|
my $session = shift; |
158
|
1
|
|
|
|
|
5
|
my $agent = $session->hostname; |
159
|
|
|
|
|
|
|
|
160
|
1
|
50
|
|
|
|
8
|
Carp::croak "$agent: '$prefix' not initialized," |
161
|
|
|
|
|
|
|
unless $session->init_ok($prefix); |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
# stash for return values |
164
|
0
|
|
|
|
|
0
|
my @route_tbl; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
my ( |
167
|
0
|
|
|
|
|
0
|
$ipRouteDest, $ipRouteMask, $ipRouteNextHop, $ipRouteIfIndex, $ipRouteMetric1, |
168
|
|
|
|
|
|
|
$ipRouteMetric2, $ipRouteMetric3, $ipRouteMetric4, $ipRouteMetric5, $ipRouteType, |
169
|
|
|
|
|
|
|
$ipRouteTypeString, $ipRouteProto, $ipRouteProtoString, $ipRouteAge, $ipRouteInfo, |
170
|
|
|
|
|
|
|
); |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
# index is ipRouteDest |
173
|
0
|
|
|
|
|
0
|
foreach my $idx ( oid_lex_sort keys %{ $session->{$prefix}{ipRouteDest} } ) { |
|
0
|
|
|
|
|
0
|
|
174
|
|
|
|
|
|
|
|
175
|
0
|
|
|
|
|
0
|
$ipRouteDest = $session->{$prefix}{ipRouteDest}{$idx}; |
176
|
0
|
|
|
|
|
0
|
$ipRouteMask = $session->{$prefix}{ipRouteMask}{$idx}; |
177
|
0
|
|
|
|
|
0
|
$ipRouteNextHop = $session->{$prefix}{ipRouteNextHop}{$idx}; |
178
|
0
|
|
|
|
|
0
|
$ipRouteIfIndex = $session->{$prefix}{ipRouteIfIndex}{$idx}; |
179
|
0
|
|
|
|
|
0
|
$ipRouteMetric1 = $session->{$prefix}{ipRouteMetric1}{$idx}; |
180
|
0
|
|
|
|
|
0
|
$ipRouteMetric2 = $session->{$prefix}{ipRouteMetric2}{$idx}; |
181
|
0
|
|
|
|
|
0
|
$ipRouteMetric3 = $session->{$prefix}{ipRouteMetric3}{$idx}; |
182
|
0
|
|
|
|
|
0
|
$ipRouteMetric4 = $session->{$prefix}{ipRouteMetric4}{$idx}; |
183
|
0
|
|
|
|
|
0
|
$ipRouteMetric5 = $session->{$prefix}{ipRouteMetric5}{$idx}; |
184
|
0
|
|
0
|
|
|
0
|
$ipRouteType = $session->{$prefix}{ipRouteType}{$idx} || -1; |
185
|
0
|
|
0
|
|
|
0
|
$ipRouteTypeString = $ip_route_type_enum{$ipRouteType} || 'unknown'; |
186
|
0
|
|
0
|
|
|
0
|
$ipRouteProto = $session->{$prefix}{ipRouteProto}{$idx} || -1; |
187
|
0
|
|
0
|
|
|
0
|
$ipRouteProtoString = $ip_route_proto_enum{$ipRouteProto} |
188
|
|
|
|
|
|
|
|| 'unknown'; |
189
|
0
|
|
|
|
|
0
|
$ipRouteAge = $session->{$prefix}{ipRouteAge}{$idx}; |
190
|
0
|
|
|
|
|
0
|
$ipRouteInfo = $session->{$prefix}{ipRouteInfo}{$idx}; |
191
|
|
|
|
|
|
|
|
192
|
0
|
|
|
|
|
0
|
push @route_tbl, |
193
|
|
|
|
|
|
|
{ |
194
|
|
|
|
|
|
|
ipRouteDest => $ipRouteDest, |
195
|
|
|
|
|
|
|
ipRouteMask => $ipRouteMask, |
196
|
|
|
|
|
|
|
ipRouteNextHop => $ipRouteNextHop, |
197
|
|
|
|
|
|
|
ipRouteIfIndex => $ipRouteIfIndex, |
198
|
|
|
|
|
|
|
ipRouteMetric1 => $ipRouteMetric1, |
199
|
|
|
|
|
|
|
ipRouteMetric2 => $ipRouteMetric2, |
200
|
|
|
|
|
|
|
ipRouteMetric3 => $ipRouteMetric3, |
201
|
|
|
|
|
|
|
ipRouteMetric4 => $ipRouteMetric4, |
202
|
|
|
|
|
|
|
ipRouteMetric5 => $ipRouteMetric5, |
203
|
|
|
|
|
|
|
ipRouteType => $ipRouteType, |
204
|
|
|
|
|
|
|
ipRouteTypeString => $ipRouteTypeString, |
205
|
|
|
|
|
|
|
ipRouteProto => $ipRouteProto, |
206
|
|
|
|
|
|
|
ipRouteProtoString => $ipRouteProtoString, |
207
|
|
|
|
|
|
|
ipRouteAge => $ipRouteAge, |
208
|
|
|
|
|
|
|
ipRouteInfo => $ipRouteInfo, |
209
|
|
|
|
|
|
|
}; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
0
|
|
|
|
|
0
|
return @route_tbl; |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=head1 INITIALIZATION |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=head2 B<< OBJ->_init($reload) >> |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Fetch the mib-II ipRouteTable from the host. Don't call this method direct! |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=cut |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# |
224
|
|
|
|
|
|
|
# due to the asynchron nature, we don't know what init job is really the last, we decrement |
225
|
|
|
|
|
|
|
# the value after each callback |
226
|
|
|
|
|
|
|
# |
227
|
4
|
|
|
4
|
|
17
|
use constant THIS_INIT_JOBS => 1; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
1807
|
|
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub _init { |
230
|
4
|
|
|
4
|
|
6245
|
my ( $session, $reload ) = @_; |
231
|
4
|
|
|
|
|
8
|
my $agent = $session->hostname; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
die "$agent: $prefix already initialized and reload not forced.\n" |
234
|
|
|
|
|
|
|
if exists get_init_slot($session)->{$prefix} |
235
|
4
|
50
|
66
|
|
|
16
|
&& get_init_slot($session)->{$prefix} == 0 |
|
|
|
33
|
|
|
|
|
236
|
|
|
|
|
|
|
&& not $reload; |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# set number of async init jobs for proper initialization |
239
|
4
|
|
|
|
|
82
|
get_init_slot($session)->{$prefix} = THIS_INIT_JOBS; |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# populate the object with needed mib values |
242
|
|
|
|
|
|
|
# |
243
|
|
|
|
|
|
|
# initialize the object for ipRouteTable infos |
244
|
4
|
|
|
|
|
24
|
_fetch_ip_route_tbl($session); |
245
|
4
|
100
|
|
|
|
27
|
return if $session->error; |
246
|
|
|
|
|
|
|
|
247
|
2
|
|
|
|
|
10
|
return 1; |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Only for developers or maintainers. |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=head2 B<< _fetch_ip_route_tbl($session) >> |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
Fetch the ipRouteTable once during object initialization. |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=cut |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
sub _fetch_ip_route_tbl { |
261
|
4
|
|
|
4
|
|
4
|
my $session = shift; |
262
|
4
|
|
|
|
|
4
|
my $result; |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
# fetch the ipRouteTable |
265
|
4
|
100
|
|
|
|
19
|
$result = $session->get_table( |
266
|
|
|
|
|
|
|
-baseoid => IP_ROUTE_TABLE, |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
# define callback if in nonblocking mode |
269
|
|
|
|
|
|
|
$session->nonblocking ? ( -callback => \&_ip_route_tbl_cb ) : (), |
270
|
|
|
|
|
|
|
); |
271
|
|
|
|
|
|
|
|
272
|
4
|
100
|
|
|
|
2006798
|
unless ( defined $result ) { |
273
|
2
|
50
|
|
|
|
10
|
if (my $err_msg = $session->error) { |
274
|
2
|
|
|
|
|
27
|
push_error($session, "$prefix: $err_msg"); |
275
|
|
|
|
|
|
|
}; |
276
|
2
|
|
|
|
|
64
|
return; |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
# in nonblocking mode the callback will be called asynchronously |
280
|
2
|
50
|
|
|
|
7
|
return 1 if $session->nonblocking; |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
# ok we are in synchronous mode, call the result mangling function |
283
|
|
|
|
|
|
|
# by hand |
284
|
0
|
|
|
|
|
0
|
_ip_route_tbl_cb($session); |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=head2 B<< _ip_route_tbl_cb($session) >> |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
The callback for _fetch_ip_route_tbl(). |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=cut |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
sub _ip_route_tbl_cb { |
295
|
2
|
|
|
2
|
|
2003719
|
my $session = shift; |
296
|
2
|
|
|
|
|
8
|
my $vbl = $session->var_bind_list; |
297
|
|
|
|
|
|
|
|
298
|
2
|
50
|
|
|
|
16
|
unless ( defined $vbl ) { |
299
|
2
|
50
|
|
|
|
7
|
if (my $err_msg = $session->error) { |
300
|
2
|
|
|
|
|
24
|
push_error($session, "$prefix: $err_msg"); |
301
|
|
|
|
|
|
|
}; |
302
|
2
|
|
|
|
|
45
|
return; |
303
|
|
|
|
|
|
|
} |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
# mangle result table to get plain idx->value |
306
|
|
|
|
|
|
|
# |
307
|
|
|
|
|
|
|
# result hashes: ipRouteDest => values |
308
|
|
|
|
|
|
|
# |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteDest} = |
311
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_DEST, undef, undef, ); |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteIfIndex} = |
314
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_IFINDEX, undef, undef, ); |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric1} = |
317
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC1, undef, undef, ); |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric2} = |
320
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC2, undef, undef, ); |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric3} = |
323
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC3, undef, undef, ); |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric4} = |
326
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC4, undef, undef, ); |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric5} = |
329
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC5, undef, undef, ); |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteNextHop} = |
332
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_NEXTHOP, undef, undef, ); |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteType} = |
335
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_TYPE, undef, undef, ); |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteProto} = |
338
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_PROTO, undef, undef, ); |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteAge} = |
341
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_AGE, undef, undef, ); |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteMask} = |
344
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_MASK, undef, undef, ); |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
$session->{$prefix}{ipRouteInfo} = |
347
|
0
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_INFO, undef, undef, ); |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
# this init job is finished |
350
|
0
|
|
|
|
|
|
get_init_slot($session)->{$prefix}--; |
351
|
|
|
|
|
|
|
|
352
|
0
|
|
|
|
|
|
return 1; |
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
unless ( caller() ) { |
356
|
|
|
|
|
|
|
print "$prefix compiles and initializes successful.\n"; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=head1 SEE ALSO |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
L<< Net::SNMP::Mixin >> |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=head1 REQUIREMENTS |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
L<< Net::SNMP >>, L<< Net::SNMP::Mixin >> |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=head1 BUGS, PATCHES & FIXES |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch. |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to gaissmai@cpan.org . |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP-Mixin-IpRouteTable |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=head1 AUTHOR |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
Karl Gaissmaier |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
Copyright 2008-2016 Karl Gaissmaier, all rights reserved. |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
385
|
|
|
|
|
|
|
under the same terms as Perl itself. |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=cut |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
1; |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
# vim: sw=2 |