9
my $numindices = shift;
10
# find all oids beginning with $entry
11
# then skip one field for the sequence
12
# then read the next numindices fields
13
my $entrypat = $entry;
14
$entrypat =~ s/\./\\\./g;
16
/^$entrypat\.\d+\.(.*)/ && $1;
21
my @o = map {[split /\./]} sort grep !$seen{$_}++, @indices;
28
my $entrypat = $entry;
29
$entrypat =~ s/\./\\\./g;
33
return scalar(@entries);
40
#my $oid = $object.'.'.join('.', @indices);
42
$oid .= '.'.join('.', @indices) if (@indices);
46
sub get_object_value {
51
my $key = get_object($oids, $object, @indices);
53
return $values->{$key};
59
#SNMP::Utils::counter([$idxs1, $idxs2], $idx1, $idx2),
60
# this flattens a n-dimensional array and returns the absolute position
61
# of the element at position idx1,idx2,...,idxn
62
# element 1,2 in table 0,0 0,1 0,2 1,0 1,1 1,2 2,0 2,1 2,2 is at pos 6
64
my $indexlists = shift; #, zeiger auf array aus [1, 2]
66
my $dimensions = scalar(@{$indexlists->[0]});
69
if ($dimensions == 1) {
71
sort { $a->[0] <=> $b->[0] } @{$indexlists};
72
} elsif ($dimensions == 2) {
74
sort { $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] } @{$indexlists};
75
} elsif ($dimensions == 3) {
77
sort { $a->[0] <=> $b->[0] ||
78
$a->[1] <=> $b->[1] ||
79
$a->[2] <=> $b->[2] } @{$indexlists};
82
if ($dimensions == 1) {
83
if ($_->[0] == $element[0]) {
86
} elsif ($dimensions == 2) {
87
if ($_->[0] == $element[0] && $_->[1] == $element[1]) {
90
} elsif ($dimensions == 3) {
91
if ($_->[0] == $element[0] &&
92
$_->[1] == $element[1] &&
93
$_->[2] == $element[2]) {