diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-10-15 12:04:34 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-10-16 18:43:20 +0000 |
commit | 71398e26f7265861e9be75973da6d1aff116e5a8 (patch) | |
tree | 548b9e92b65ebd2863749a5cdf48c427bb352c63 /tools/make-manuf | |
parent | 6a98d59e764c3e4144887bfbf52d402b13d9efee (diff) |
Add OUI-28 to make-manuf.
Change-Id: I95b9a4422dab6efbc2d94be49aba5f42784ff3e8
Reviewed-on: https://code.wireshark.org/review/11064
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools/make-manuf')
-rwxr-xr-x | tools/make-manuf | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/tools/make-manuf b/tools/make-manuf index 93e028ec2f..7c51b13167 100755 --- a/tools/make-manuf +++ b/tools/make-manuf @@ -33,10 +33,9 @@ $template = "manuf.tmpl"; $wkatmpl = "wka.tmpl"; $outfile = "manuf"; $inheader = 1; -# According to http://standards.ieee.org/regauthmaint.html -# the IEEE is adding OUI-28 in January 2014. $oui_url = "http://standards.ieee.org/develop/regauth/oui/oui.txt"; $iab_url = "http://standards.ieee.org/develop/regauth/iab/iab.txt"; +$oui28_url = "http://standards.ieee.org/develop/regauth/oui28/oui28.txt"; $oui36_url = "http://standards.ieee.org/develop/regauth/oui36/oui36.txt"; $cb_url = "http://www.cavebear.com/archive/cavebear/Ethernet/Ethernet.txt"; %oui_list = (); @@ -57,6 +56,9 @@ $oui_total = 0; $iab_added = 0; $iab_skipped = 0; $iab_total = 0; +$oui28_added = 0; +$oui28_skipped = 0; +$oui28_total = 0; $oui36_added = 0; $oui36_skipped = 0; $oui36_total = 0; @@ -146,6 +148,34 @@ foreach $line (split(/\n/, $ieee_list)) { if ($iab_total < $min_entries) { die "Too few IAB entries ($iab_total)\n"; } +# Add IEEE entries for OUI-28 + +$ieee_list = fetch($oui28_url); + +foreach $line (split(/\n/, $ieee_list)) { + # determine the OUI used for OUI-28 + if (($oui28_tmp, $manuf) = ($line =~ /^\s*($ieee_re)\s+\(hex\)\s+(\S.*)$/)) { + $oui28_base = $oui28_tmp; + } + # determine next two bytes + if (($oui28_4, $oui28_5, $manuf) = ($line =~ /^\s*($hp)($hp)$hp-$hp$hp$hp\s+\(base\s16\)\s+(\S.*)$/)) { + $oui28 = "$oui28_base:$oui28_4:$oui28_5:00/28"; + $oui28 =~ tr /-/:/; # The IEEE bytes are separated by dashes. + # Ensure OUI-28 is all upper-case + $oui28 =~ tr/a-f/A-F/; + if (exists $oui_list{$oui28}) { + printf "$oui28 - Skipping IEEE \"$manuf\" in favor of \"$oui_list{$oui28}\"\n"; + $oui28_skipped++; + } else { + $oui_list{$oui28} = &shorten($manuf); + $oui28_added++; + } + } + $oui28_total++; +} + +if ($oui28_total < $min_entries) { die "Too few OUI-28 entries ($oui28_total)\n"; } + # Add IEEE entries for OUI-36 $ieee_list = fetch($oui36_url); @@ -254,12 +284,14 @@ 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 CaveBear added : $cb_added Total : $total_added IEEE OUI skipped : $oui_skipped IEEE IAB skipped : $iab_skipped +IEEE OUI28 skipd : $oui28_skipped IEEE OUI36 skipd : $oui36_skipped CaveBear skipped : $cb_skipped Fin |