Last active
February 20, 2022 23:17
-
-
Save ork/8508228 to your computer and use it in GitHub Desktop.
Parse IEEE OUI vendor list to JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# Parse IEEE OUI vendor list to JSON | |
# http://standards.ieee.org/develop/regauth/oui/oui.txt | |
# --- | |
# Usage: | |
# $ chmod +x parseoui.awk | |
# $ wget http://standards.ieee.org/develop/regauth/oui/oui.txt | |
# $ ./parseoui.awk oui.txt > oui.json | |
BEGIN { | |
print "["; | |
} | |
/(hex)/ { | |
printf "{ \"oui\": \"%s\", \"vendor\": \"%s\"},\n", $1, substr($0, index($0, $3)); | |
} | |
END { | |
print "]"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment