aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2020-11-29 08:49:50 -0800
committerAndersBroman <a.broman58@gmail.com>2021-01-01 10:27:35 +0000
commit894a70d0796a96f25fe6f0dd017c7b1faad9819f (patch)
tree4bd85e679022f3d5a86b93c2eefd08e82a5074b3 /tools
parent26a822c968077076058d6245f04a56660a247d80 (diff)
Remove a bunch of duplicate manuf.tmpl entries.
Update make-manuf.py to print "Skipping duplicate IEEE ..." when the organization names are the same. Remove duplicates by running tools/make-manuf.py | awk '/Skipping duplicate IEEE/ {printf "^%s\t\n", $1 }' > /tmp/duplicates.pat grep -v -f /tmp/duplicates.pat manuf.tmpl > manuf.tmpl.new ; mv manuf.tmpl.new manuf.tmpl
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-manuf.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/make-manuf.py b/tools/make-manuf.py
index 414d484849..bac14407c5 100755
--- a/tools/make-manuf.py
+++ b/tools/make-manuf.py
@@ -243,7 +243,16 @@ def main():
oui = prefix_to_oui(ieee_row[1].upper())
manuf = ieee_row[2].strip()
if oui in oui_d:
- print(u'{} - Skipping IEEE "{}" in favor of "{}"'.format(oui, manuf, oui_d[oui]))
+ action = 'Skipping'
+ try:
+ manuf_stripped = re.findall('[a-z]+', manuf.lower())
+ tmpl_manuf_stripped = re.findall('[a-z]+', oui_d[oui].split('\t')[-1].strip().lower())
+ if manuf_stripped == tmpl_manuf_stripped:
+ action = 'Skipping duplicate'
+ except IndexError:
+ pass
+
+ print(u'{} - {} IEEE "{}" in favor of "{}"'.format(oui, action, manuf, oui_d[oui]))
ieee_d[db]['skipped'] += 1
else:
oui_d[oui] = shorten(manuf)