summaryrefslogtreecommitdiff
path: root/package/libipfix
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-12-19 22:19:34 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-12-19 22:19:34 +0000
commit93f368cb2307347a1824716a2e1e435df77dd067 (patch)
tree9d570901b32ff983550204c969f4369f7de0408b /package/libipfix
parent2caa29bc44ab2b036b68389a0dbbc19ddc344973 (diff)
downloadmtk-20170518-93f368cb2307347a1824716a2e1e435df77dd067.zip
mtk-20170518-93f368cb2307347a1824716a2e1e435df77dd067.tar.gz
mtk-20170518-93f368cb2307347a1824716a2e1e435df77dd067.tar.bz2
libipfix: specify the number of the wprobe ie append script on the command line
SVN-Revision: 18855
Diffstat (limited to 'package/libipfix')
-rw-r--r--package/libipfix/extra/append-wprobe-ie.pl17
1 files changed, 7 insertions, 10 deletions
diff --git a/package/libipfix/extra/append-wprobe-ie.pl b/package/libipfix/extra/append-wprobe-ie.pl
index fa838ff..8bb658b 100644
--- 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 ],
);
-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";
-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;
@@ -28,7 +24,7 @@ while (<STDIN>) {
@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];
@@ -38,4 +34,5 @@ while (<STDIN>) {
}
};
}
+close FILE;