Changeset 896
- Timestamp:
- 04/04/05 04:45:41 (7 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/ilmari/modularisation-branch/node/SNMP.pm.in
r866 r896 117 117 [-contextengineid => $engine_id,] # v3 118 118 [-contextname => $name,] # v3 119 [-rows => \@rows,] 119 120 -baseoid => $oid, 120 121 -cols => \%columns … … 122 123 123 124 This method calls C<get_table()> with all the given arguments except 124 C<-cols> , and then transforms the data into a hash of hashes in the125 following manner:125 C<-cols> and C<-rows>, and then transforms the data into a hash of 126 hashes in the following manner: 126 127 127 128 The keys of the main hash are the last element(s) of the OIDs, after … … 129 130 are hashes with keys corresponding to the values of C<%columns> hash and 130 131 values from the subtables corresonding to the keys of C<%columns>. 132 133 If C<@rows> is specified, only returns those rows. 131 134 132 135 For this to work, all the keys of C<-cols> must have the same number of … … 141 144 2 => 'descr', 142 145 4 => 'mtu', 143 } 146 }, 144 147 ); 145 148 … … 178 181 my $base = $args{'-baseoid'}; 179 182 my $cols = delete $args{'-cols'} or return; 183 my $rows = delete $args{'-rows'}; 180 184 181 185 my $table = $self->get_table(%args) 182 186 or return; 183 187 188 my $rowre; 189 if (defined $rows) { 190 $rowre = join '|', @$rows; 191 } else { 192 $rowre = '.*'; 193 } 194 184 195 my $subtabs = join '|', keys %$cols; 185 my $re = qr/^\Q$base.\E($subtabs)\.( .*)/;196 my $re = qr/^\Q$base.\E($subtabs)\.($rowre)/; 186 197 for my $key (keys %$table) { 187 198 $key =~ $re;
