#!/usr/bin/perl -w
#
-# $Id: make-manuf,v 1.10 2003/01/21 20:20:09 jmayer Exp $
+# $Id$
#
# Make-manuf - Creates a file containing ethernet OUIs and their
# company IDs. It merges the databases at
my $origmanuf = shift;
my $manuf = " " . $origmanuf . " ";
# Remove any punctuation
- $manuf =~ tr/,.()/ /;
+ $manuf =~ tr/',.()/ /;
# & isn't needed when Standalone
$manuf =~ s/ \& / /g;
# Remove any "the", "inc", "plc" ...
- $manuf =~ s/\s(the|inc|incorporated|plc||systems|corp|corporation|a\/s|ab|ag|kg|gmbh|co|company|limited|ltd)(?= )//gi;
+ $manuf =~ s/\s(the|inc|incorporated|plc||systems|corp|corporation|s\/a|a\/s|ab|ag|kg|gmbh|co|company|limited|ltd)(?= )//gi;
# Convert to consistent case
$manuf =~ s/(\w+)/\u\L$1/g;
# Remove all spaces
if ($manuf =~ /\Q$origmanuf\E/i) {
return $manuf;
} else {
- return sprintf("%-22s # %s\n", $manuf, $origmanuf);
+ return sprintf("%-22s # %s", $manuf, $origmanuf);
}
}
# Ensure OUI is all upper-case
$oui =~ tr/a-f/A-F/;
if (exists $oui_list{$oui}) {
- printf "$oui - Skipping CaveBear \"$manuf\" in favor of \"$oui_list{$oui}\"\n";
+ # printf "$oui - Skipping CaveBear \"$manuf\" in favor of \"$oui_list{$oui}\"\n";
$cb_skipped++;
} else {
+ printf "$oui - adding \"$manuf\" from CaveBear\n";
$oui_list{$oui} = &shorten($manuf);
$cb_added++;
}
open (OUT, "> $outfile") ||
die "Couldn't open output file for writing ($outfile)\n";
+print(OUT "# This file was generated by running ./make-manuf.\n");
+print(OUT "# Don't change it directly, change manuf.tmpl and wka.tmpl instead.\n#\n");
print(OUT "$header");
foreach $oui (sort(keys %oui_list)) {