projects
/
lede.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2caa29b
)
libipfix: specify the number of the wprobe ie append script on the command line
author
Felix Fietkau
<nbd@openwrt.org>
Sat, 19 Dec 2009 22:19:34 +0000
(22:19 +0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 19 Dec 2009 22:19:34 +0000
(22:19 +0000)
SVN-Revision: 18855
package/libipfix/extra/append-wprobe-ie.pl
patch
|
blob
|
history
diff --git
a/package/libipfix/extra/append-wprobe-ie.pl
b/package/libipfix/extra/append-wprobe-ie.pl
index fa838ff76a36d77f48ea0f3ad80e77788fb3af4c..8bb658bbb9521c979d520de5cf9198cdf2f876d0 100644
(file)
--- a/
package/libipfix/extra/append-wprobe-ie.pl
+++ b/
package/libipfix/extra/append-wprobe-ie.pl
@@
-6,16
+6,12
@@
my @fields = (
[ "_ss", "UINT", " - Sum of squared samples", 8 ],
);
[ "_ss", "UINT", " - Sum of squared samples", 8 ],
);
-my $file = $ARGV[0] or die "Syntax: $0 <file>\n";
+my $file = $ARGV[0] or die "Syntax: $0 <file>
<start>
\n";
-f $file or die "File not found\n";
-f $file or die "File not found\n";
-my $last_ie = 0;
-my $line;
-open IES, "<$file" or die "Can't open file";
-while ($line = <IES>) {
- $line =~ /^(\d+)\s*,/ and $last_ie = $1;
-}
-close IES;
-while (<STDIN>) {
+my $start = $ARGV[1];
+$start =~ /^\d+$/ or die "Invalid start number";
+open FILE, "<$file" or die "Can't open file";
+while (<FILE>) {
/^(%?)(\w+),\s*(\w+),\s*(.+)$/ and do {
my $counter = $1;
my $rfield = $2;
/^(%?)(\w+),\s*(\w+),\s*(.+)$/ and do {
my $counter = $1;
my $rfield = $2;
@@
-28,7
+24,7
@@
while (<STDIN>) {
@f = @fields;
}
foreach my $f (@f) {
@f = @fields;
}
foreach my $f (@f) {
- my $nr =
++$last_ie
;
+ my $nr =
$start++
;
my $n = $f->[0];
my $N = uc $n;
my $ftype = $f->[1];
my $n = $f->[0];
my $N = uc $n;
my $ftype = $f->[1];
@@
-38,4
+34,5
@@
while (<STDIN>) {
}
};
}
}
};
}
+close FILE;