line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SNMP::Mixin::IpRouteTable; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
477201
|
use strict; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
168
|
|
4
|
4
|
|
|
4
|
|
26
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
296
|
|
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
|
|
24
|
use Carp (); |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
97
|
|
17
|
4
|
|
|
4
|
|
1490
|
use Net::SNMP qw/oid_lex_sort/; |
|
4
|
|
|
|
|
100172
|
|
|
4
|
|
|
|
|
679
|
|
18
|
4
|
|
|
4
|
|
4543
|
use Net::SNMP::Mixin::Util qw/idx2val push_error/; |
|
4
|
|
|
|
|
18213
|
|
|
4
|
|
|
|
|
32
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
# this module export config |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
my @mixin_methods; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
BEGIN { |
26
|
4
|
|
|
4
|
|
1425
|
@mixin_methods = (qw/ get_ip_route_table /); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
37
|
use Sub::Exporter -setup => { |
30
|
|
|
|
|
|
|
exports => [@mixin_methods], |
31
|
|
|
|
|
|
|
groups => { default => [@mixin_methods], }, |
32
|
4
|
|
|
4
|
|
34
|
}; |
|
4
|
|
|
|
|
8
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# |
35
|
|
|
|
|
|
|
# SNMP oid constants used in this module |
36
|
|
|
|
|
|
|
# |
37
|
|
|
|
|
|
|
# from mib-II |
38
|
|
|
|
|
|
|
use constant { |
39
|
4
|
|
|
|
|
5615
|
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
|
|
1795
|
}; |
|
4
|
|
|
|
|
8
|
|
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.03 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
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
|
|
|
|
|
|
|
|
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
|
47071
|
my $session = shift; |
158
|
1
|
50
|
|
|
|
157
|
Carp::croak "'$prefix' not initialized," |
159
|
|
|
|
|
|
|
unless $session->{$prefix}{__initialized}; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# stash for return values |
162
|
0
|
|
|
|
|
0
|
my @route_tbl; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
my ( |
165
|
0
|
|
|
|
|
0
|
$ipRouteDest, $ipRouteMask, $ipRouteNextHop, |
166
|
|
|
|
|
|
|
$ipRouteIfIndex, $ipRouteMetric1, $ipRouteMetric2, |
167
|
|
|
|
|
|
|
$ipRouteMetric3, $ipRouteMetric4, $ipRouteMetric5, |
168
|
|
|
|
|
|
|
$ipRouteType, $ipRouteTypeString, $ipRouteProto, |
169
|
|
|
|
|
|
|
$ipRouteProtoString, $ipRouteAge, $ipRouteInfo, |
170
|
|
|
|
|
|
|
); |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
# index is ipRouteDest |
173
|
0
|
|
|
|
|
0
|
foreach |
174
|
0
|
|
|
|
|
0
|
my $idx ( oid_lex_sort keys %{ $session->{$prefix}{ipRouteDest} } ) |
175
|
|
|
|
|
|
|
{ |
176
|
|
|
|
|
|
|
|
177
|
0
|
|
|
|
|
0
|
$ipRouteDest = $session->{$prefix}{ipRouteDest}{$idx}; |
178
|
0
|
|
|
|
|
0
|
$ipRouteMask = $session->{$prefix}{ipRouteMask}{$idx}; |
179
|
0
|
|
|
|
|
0
|
$ipRouteNextHop = $session->{$prefix}{ipRouteNextHop}{$idx}; |
180
|
0
|
|
|
|
|
0
|
$ipRouteIfIndex = $session->{$prefix}{ipRouteIfIndex}{$idx}; |
181
|
0
|
|
|
|
|
0
|
$ipRouteMetric1 = $session->{$prefix}{ipRouteMetric1}{$idx}; |
182
|
0
|
|
|
|
|
0
|
$ipRouteMetric2 = $session->{$prefix}{ipRouteMetric2}{$idx}; |
183
|
0
|
|
|
|
|
0
|
$ipRouteMetric3 = $session->{$prefix}{ipRouteMetric3}{$idx}; |
184
|
0
|
|
|
|
|
0
|
$ipRouteMetric4 = $session->{$prefix}{ipRouteMetric4}{$idx}; |
185
|
0
|
|
|
|
|
0
|
$ipRouteMetric5 = $session->{$prefix}{ipRouteMetric5}{$idx}; |
186
|
0
|
|
0
|
|
|
0
|
$ipRouteType = $session->{$prefix}{ipRouteType}{$idx} || -1; |
187
|
0
|
|
0
|
|
|
0
|
$ipRouteTypeString = $ip_route_type_enum{$ipRouteType} || 'unknown'; |
188
|
0
|
|
0
|
|
|
0
|
$ipRouteProto = $session->{$prefix}{ipRouteProto}{$idx} || -1; |
189
|
0
|
|
0
|
|
|
0
|
$ipRouteProtoString = $ip_route_proto_enum{$ipRouteProto} |
190
|
|
|
|
|
|
|
|| 'unknown'; |
191
|
0
|
|
|
|
|
0
|
$ipRouteAge = $session->{$prefix}{ipRouteAge}{$idx}; |
192
|
0
|
|
|
|
|
0
|
$ipRouteInfo = $session->{$prefix}{ipRouteInfo}{$idx}; |
193
|
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
0
|
push @route_tbl, |
195
|
|
|
|
|
|
|
{ |
196
|
|
|
|
|
|
|
ipRouteDest => $ipRouteDest, |
197
|
|
|
|
|
|
|
ipRouteMask => $ipRouteMask, |
198
|
|
|
|
|
|
|
ipRouteNextHop => $ipRouteNextHop, |
199
|
|
|
|
|
|
|
ipRouteIfIndex => $ipRouteIfIndex, |
200
|
|
|
|
|
|
|
ipRouteMetric1 => $ipRouteMetric1, |
201
|
|
|
|
|
|
|
ipRouteMetric2 => $ipRouteMetric2, |
202
|
|
|
|
|
|
|
ipRouteMetric3 => $ipRouteMetric3, |
203
|
|
|
|
|
|
|
ipRouteMetric4 => $ipRouteMetric4, |
204
|
|
|
|
|
|
|
ipRouteMetric5 => $ipRouteMetric5, |
205
|
|
|
|
|
|
|
ipRouteType => $ipRouteType, |
206
|
|
|
|
|
|
|
ipRouteTypeString => $ipRouteTypeString, |
207
|
|
|
|
|
|
|
ipRouteProto => $ipRouteProto, |
208
|
|
|
|
|
|
|
ipRouteProtoString => $ipRouteProtoString, |
209
|
|
|
|
|
|
|
ipRouteAge => $ipRouteAge, |
210
|
|
|
|
|
|
|
ipRouteInfo => $ipRouteInfo, |
211
|
|
|
|
|
|
|
}; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
0
|
return @route_tbl; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=head1 INITIALIZATION |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=head2 B<< OBJ->_init($reload) >> |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
Fetch the mib-II ipRouteTable from the host. Don't call this method direct! |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=cut |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
sub _init { |
226
|
4
|
|
|
4
|
|
13023
|
my ( $session, $reload ) = @_; |
227
|
|
|
|
|
|
|
|
228
|
4
|
50
|
33
|
|
|
60
|
die "$prefix already initalized and reload not forced.\n" |
229
|
|
|
|
|
|
|
if $session->{$prefix}{__initialized} && not $reload; |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
# populate the object with needed mib values |
232
|
|
|
|
|
|
|
# |
233
|
|
|
|
|
|
|
# initialize the object for ipRouteTable infos |
234
|
4
|
|
|
|
|
13
|
_fetch_ip_route_tbl($session); |
235
|
4
|
100
|
|
|
|
32
|
return if $session->error; |
236
|
|
|
|
|
|
|
|
237
|
2
|
|
|
|
|
21
|
return 1; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
Only for developers or maintainers. |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=head2 B<< _fetch_ip_route_tbl($session) >> |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
Fetch the ipRouteTable once during object initialization. |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=cut |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub _fetch_ip_route_tbl { |
251
|
4
|
|
|
4
|
|
9
|
my $session = shift; |
252
|
4
|
|
|
|
|
6
|
my $result; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
# fetch the ipRouteTable |
255
|
4
|
100
|
|
|
|
38
|
$result = $session->get_table( |
256
|
|
|
|
|
|
|
-baseoid => IP_ROUTE_TABLE, |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
# define callback if in nonblocking mode |
259
|
|
|
|
|
|
|
$session->nonblocking ? ( -callback => \&_ip_route_tbl_cb ) : (), |
260
|
|
|
|
|
|
|
); |
261
|
|
|
|
|
|
|
|
262
|
4
|
100
|
|
|
|
2018692
|
unless ( defined $result ) { |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
# Net::SNMP looses sometimes error messages in nonblocking |
265
|
|
|
|
|
|
|
# mode, so we save them in an extra buffer |
266
|
2
|
|
|
|
|
15
|
my $err_msg = $session->error; |
267
|
2
|
50
|
|
|
|
406
|
push_error( $session, "$prefix: $err_msg" ) if $err_msg; |
268
|
2
|
|
|
|
|
41
|
return; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# in nonblocking mode the callback will be called asynchronously |
272
|
2
|
50
|
|
|
|
10
|
return 1 if $session->nonblocking; |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
# ok we are in synchronous mode, call the result mangling function |
275
|
|
|
|
|
|
|
# by hand |
276
|
0
|
|
|
|
|
0
|
_ip_route_tbl_cb($session); |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head2 B<< _ip_route_tbl_cb($session) >> |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
The callback for _fetch_ip_route_tbl(). |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=cut |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub _ip_route_tbl_cb { |
287
|
2
|
|
|
2
|
|
2006858
|
my $session = shift; |
288
|
2
|
|
|
|
|
10
|
my $vbl = $session->var_bind_list; |
289
|
|
|
|
|
|
|
|
290
|
2
|
50
|
|
|
|
24
|
unless ( defined $vbl ) { |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
# Net::SNMP looses sometimes error messages in nonblocking |
293
|
|
|
|
|
|
|
# mode, so we save them in an extra buffer |
294
|
2
|
|
|
|
|
10
|
my $err_msg = $session->error; |
295
|
2
|
50
|
|
|
|
29
|
push_error( $session, "$prefix: $err_msg" ) if $err_msg; |
296
|
2
|
|
|
|
|
45
|
return; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# mangle result table to get plain idx->value |
300
|
|
|
|
|
|
|
# |
301
|
|
|
|
|
|
|
# result hashes: ipRouteDest => values |
302
|
|
|
|
|
|
|
# |
303
|
|
|
|
|
|
|
|
304
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteDest} = |
305
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_DEST, undef, undef, ); |
306
|
|
|
|
|
|
|
|
307
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteIfIndex} = |
308
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_IFINDEX, undef, undef, ); |
309
|
|
|
|
|
|
|
|
310
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric1} = |
311
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC1, undef, undef, ); |
312
|
|
|
|
|
|
|
|
313
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric2} = |
314
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC2, undef, undef, ); |
315
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric3} = |
317
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC3, undef, undef, ); |
318
|
|
|
|
|
|
|
|
319
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric4} = |
320
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC4, undef, undef, ); |
321
|
|
|
|
|
|
|
|
322
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMetric5} = |
323
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_METRIC5, undef, undef, ); |
324
|
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteNextHop} = |
326
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_NEXTHOP, undef, undef, ); |
327
|
|
|
|
|
|
|
|
328
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteType} = |
329
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_TYPE, undef, undef, ); |
330
|
|
|
|
|
|
|
|
331
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteProto} = |
332
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_PROTO, undef, undef, ); |
333
|
|
|
|
|
|
|
|
334
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteAge} = |
335
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_AGE, undef, undef, ); |
336
|
|
|
|
|
|
|
|
337
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteMask} = |
338
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_MASK, undef, undef, ); |
339
|
|
|
|
|
|
|
|
340
|
0
|
|
|
|
|
|
$session->{$prefix}{ipRouteInfo} = |
341
|
|
|
|
|
|
|
idx2val( $vbl, IP_ROUTE_INFO, undef, undef, ); |
342
|
|
|
|
|
|
|
|
343
|
0
|
|
|
|
|
|
$session->{$prefix}{__initialized}++; |
344
|
|
|
|
|
|
|
} |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
unless ( caller() ) { |
347
|
|
|
|
|
|
|
print "$prefix compiles and initializes successful.\n"; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=head1 SEE ALSO |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
L<< Net::SNMP::Mixin >> |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=head1 REQUIREMENTS |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
L<< Net::SNMP >>, L<< Net::SNMP::Mixin >> |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=head1 BUGS, PATCHES & FIXES |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
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. |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
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 . |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP-Mixin-IpRouteTable |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=head1 AUTHOR |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
Karl Gaissmaier |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
Copyright 2008-2011 Karl Gaissmaier, all rights reserved. |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
376
|
|
|
|
|
|
|
under the same terms as Perl itself. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=cut |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
1; |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
# vim: sw=2 |