aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2012-08-23 21:31:20 +0000
committerMichael Mann <mmann78@netscape.net>2012-08-23 21:31:20 +0000
commit8242949ebce864a8d59ed0233149a77f98f89178 (patch)
treedd2f4001eb2e8ef392db0014e6441299d3aac1c8 /tools
parent64fa3d40368c3c592116ed64485e9f678e8eebef (diff)
Allow proto filter names to have a period in them and allow display filter names to use any period separated value as a prefix. For example "gmr1.foo.bar" would allow "gmr1", "gmr1.foo" and "gmr1.foo.bar" as valid prefixes. Otherwise it will be flagged as a possible error.
Also added a "FILE TYPE" for proto filter names with a period so that they can be verified. Presumably only "large", possibly "meta" protocols (probably spanning multiple dissector files) will be allowed to use a period in the proto filter name. svn path=/trunk/; revision=44648
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkfiltername.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/checkfiltername.pl b/tools/checkfiltername.pl
index 2932bfcbf1..12f7405fee 100755
--- a/tools/checkfiltername.pl
+++ b/tools/checkfiltername.pl
@@ -64,6 +64,7 @@ my @nofieldfilelist;
my %unique;
my @uniquefilelist;
my @noregprotocolfilelist;
+my @periodinfilternamefilelist;
my $showlinenoFlag = '';
my $showautomatedFlag = '';
@@ -90,6 +91,7 @@ my $totalerrorcount = 0;
my $errorfilecount = 0;
my $onefield = 0;
my $nofields = 0;
+my $noperiod = 0;
my $noregprotocol = 1;
my $automated = 0;
my $more_tokens;
@@ -102,6 +104,8 @@ my $error = 0;
sub checkprotoabbrev {
my $abbrev = "";
my $abbrevpos;
+ my $proto_abbrevpos1;
+ my $proto_abbrevpos2;
my $afterabbrev = "";
my $modprotabbrev = "";
my $errorline = 0;
@@ -126,6 +130,18 @@ sub checkprotoabbrev {
foreach (@protocols) {
if ($abbrev eq $_) {
$errorline = 0;
+ } elsif (index($_, ".") != -1) {
+
+ #compare from start of string for each period found
+ $proto_abbrevpos1 = 0;
+ while ((($proto_abbrevpos2 = index($_, ".", $proto_abbrevpos1)) != -1) &&
+ ($errorline == 1)) {
+ if ($abbrev eq substr($_, 0, $proto_abbrevpos2)) {
+ $errorline = 0;
+ }
+
+ $proto_abbrevpos1 = $proto_abbrevpos2+1;
+ }
}
}
}
@@ -314,6 +330,7 @@ while (<>) {
$automated = 0;
$nofields = 0;
$onefield = 0;
+ $noperiod = 0;
$linenumber = 1;
%filters = ( );
@protocols = ( );
@@ -395,6 +412,10 @@ while (<>) {
} elsif (($state eq "s_proto_short_name") && ($restofline =~ /\s*\"([^\"]*)\"\s*(.*)/)) {
$more_tokens = 0;
$state = "s_proto_filter_name";
+ if ((index($1, ".") != -1) && ($noperiod == 0)) {
+ push(@periodinfilternamefilelist, "$currfile\n");
+ $noperiod = 1;
+ }
push(@protocols, $1);
$debug>1 && print "proto filter name: '$1'\n";
} elsif (($state eq "s_proto_short_name") && ($restofline =~ /\s*(([\w\d])+)\s*(.*)/)) {
@@ -506,6 +527,11 @@ if ($filecount > 1) {
foreach (@nofieldfilelist) {
print $_;
}
+
+ print "\nPERIOD IN PROTO FILTER NAME FILE LIST\n";
+ foreach (@periodinfilternamefilelist) {
+ print $_;
+ }
}
print "\n";