summaryrefslogtreecommitdiff
path: root/hwdb/ids-update.pl
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-11-07 14:05:21 +0100
committerKay Sievers <kay@vrfy.org>2012-11-07 14:23:05 +0100
commit448004c340d41f1b7eb3c06cbd694b8862e6524d (patch)
tree75f8b89bb14c9dd35418ec532f8050eb81b3cf8b /hwdb/ids-update.pl
parentc67fbe4c71977de14ebd09a8c250ef8091dff231 (diff)
hwdb: add IEEE OUI data
Diffstat (limited to 'hwdb/ids-update.pl')
-rwxr-xr-xhwdb/ids-update.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/hwdb/ids-update.pl b/hwdb/ids-update.pl
index d157040deb..3e0c14b0b2 100755
--- a/hwdb/ids-update.pl
+++ b/hwdb/ids-update.pl
@@ -78,3 +78,23 @@ while (my $line = <IN>) {
}
close(INP);
close(OUTP);
+
+open(IN, "<", "oui.txt");
+open(OUT, ">", "20-OUI-vendor.hwdb");
+print(OUT "# This file is part of systemd.\n" .
+ "#\n" .
+ "# Data imported and updated from: http://standards.ieee.org/develop/regauth/oui/oui.txt\n");
+
+while (my $line = <IN>) {
+ $line =~ s/\s+$//;
+ $line =~ m/^([0-9A-F]{6})\s*\(base 16\)\s*(.*)$/;
+ if (defined $1) {
+ my $vendor = uc $1;
+ my $text = $2;
+ print(OUT "\n");
+ print(OUT "OUI:" . $vendor . "\n");
+ print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
+ }
+}
+close(INP);
+close(OUTP);