diff options
author | Gerald Combs <gerald@zing.org> | 2016-10-02 12:03:34 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-10-02 19:05:46 +0000 |
commit | 7a6610fc996940974eaafdcf8bff19298308ed72 (patch) | |
tree | 5e96c7d684ecc02b735ce38264563f9c5263ebf0 /tools | |
parent | 37f37bb6b6d18cd346b19b7fa092f447d085f5e9 (diff) |
make-manuf: Add more sanity checks.
Increase the number of minimum entries required in each IAB / OUI file
to 1000. Add a minimum total entry count. Add total counts to the
output. Trim whitespace so that we pass the pre-commit hook.
Re-run make-manuf to fix the mass removal in g3ab0137.
Change-Id: I6f924969c1b494f2e0b62570a459e99ba5c1b02f
Reviewed-on: https://code.wireshark.org/review/18030
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/make-manuf | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/tools/make-manuf b/tools/make-manuf index 3710ab89f0..e00ea09c1d 100755 --- a/tools/make-manuf +++ b/tools/make-manuf @@ -17,6 +17,11 @@ # of the entries feature sequences listed at # http://www.i18nqa.com/debug/utf8-debug.html +# As of October 2016 the download links at +# http://standards.ieee.org/develop/regauth/ +# point to CSV files. We might want to download and parse those in favor +# of our current text munging. + use Encode; use open ':encoding(utf8)'; @@ -43,7 +48,8 @@ $hp = "[0-9a-fA-F]{2}"; $oui_re = "$hp:$hp:$hp"; $ieee_re = "$hp-$hp-$hp"; -$min_entries = 100; +$min_entries = 1000; +$min_total = 27000; # 27196 as of 2016-10-02 $tmpl_added = 0; $oui_added = 0; @@ -62,6 +68,8 @@ $oui36_total = 0; sub shorten { my $origmanuf = shift; + # Trim leading (probably not needed) & trailing (absolutely needed) space. + $origmanuf =~ s/^\s+|\s+$//g; my $manuf = " " . $origmanuf . " "; # Remove any punctuation $manuf =~ tr/',.()/ /; @@ -224,6 +232,9 @@ foreach $line (split(/[\r\n]+/, $ieee_list)) { if ($oui_total < $min_entries) { die "Too few OUI entries ($oui_total)\n"; } +$total_added = $tmpl_added + $oui_added + $iab_added; +if ($total_added < $min_total) { die "Too few total entries ($total_added)\n"; } + # Write output file open (OUT, "> $outfile") || @@ -253,17 +264,21 @@ while ($line = <WKATMPL>) { print(OUT "$line\n"); } -$total_added = $tmpl_added + $oui_added + $iab_added; print <<"Fin" -Original entries : $tmpl_added -IEEE OUI added : $oui_added -IEEE IAB added : $iab_added -IEEE OUI28 added : $oui28_added -IEEE OUI36 added : $oui36_added -Total : $total_added - -IEEE OUI skipped : $oui_skipped -IEEE IAB skipped : $iab_skipped -IEEE OUI28 skipd : $oui28_skipped -IEEE OUI36 skipd : $oui36_skipped +Original entries : $tmpl_added +IEEE OUI added : $oui_added +IEEE IAB added : $iab_added +IEEE OUI28 added : $oui28_added +IEEE OUI36 added : $oui36_added +Total added : $total_added + +IEEE OUI total : $oui_total +IEEE IAB total : $iab_total +IEEE OUI28 total : $oui28_total +IEEE OUI36 total : $oui36_added + +IEEE OUI skipped : $oui_skipped +IEEE IAB skipped : $iab_skipped +IEEE OUI28 skipd : $oui28_skipped +IEEE OUI36 skipped : $oui36_skipped Fin |