|
@@ -1,4 +1,4 @@
|
|
|
-#!/usr/bin/python
|
|
|
+#!/usr/bin/python3
|
|
|
#
|
|
|
|
|
|
import argparse
|
|
@@ -10,27 +10,47 @@ import re
|
|
|
PREFIX = "gluon-ffho"
|
|
|
VENDORS = {
|
|
|
'8devices' : '8 Devices',
|
|
|
+ 'aerohive' : 'Aerohive',
|
|
|
'a5' : 'A5',
|
|
|
'alfa-network' : 'Alfa Network',
|
|
|
'allnet' : 'Allnet',
|
|
|
+ 'arcadyan' : 'Arcadyan',
|
|
|
'avm' : 'AVM',
|
|
|
+ 'aruba' : 'Aruba',
|
|
|
+ 'asus' : 'ASUS',
|
|
|
'buffalo' : 'Buffalo',
|
|
|
+ 'cudy' : 'Cudy',
|
|
|
'd-link' : 'D-Link',
|
|
|
+ 'devolo' : 'Devolo',
|
|
|
+ 'egenius' : 'Egenius',
|
|
|
+ 'enterasys' : 'Enterasys',
|
|
|
+ 'extreme-networks' : 'Extreme Networks',
|
|
|
+ 'friendlyelec' : 'Friendlyelec',
|
|
|
'gl' : 'GL',
|
|
|
- 'gl-inet' : 'GL.Inet',
|
|
|
- 'lemarker' : 'Lemarker',
|
|
|
+ 'gl.inet' : 'GL.Inet',
|
|
|
+ 'joy-it' : 'Joy It',
|
|
|
+ 'lemaker' : 'Lemaker',
|
|
|
'linksys' : 'Linksys',
|
|
|
+ 'mercusys' : 'Mercusys',
|
|
|
+ 'mikrotik' : 'Mikrotik',
|
|
|
'netgear' : 'Netgear',
|
|
|
+ 'nexx' : 'Nexx',
|
|
|
'ocedo' : 'Ocedo',
|
|
|
'onion' : 'Onion',
|
|
|
'openmesh' : 'Openmesh',
|
|
|
+ 'plasma' : 'Plasma',
|
|
|
+ 'ravpower' : 'RAVPower',
|
|
|
'raspberri-pi' : 'Raspberri Pi',
|
|
|
+ 'siemens' : 'Siemens',
|
|
|
+ 'sophos' : 'Sophos',
|
|
|
+ 'teltonika' : 'Teltonika',
|
|
|
'tp-link' : 'TP-Link',
|
|
|
'ubiquiti' : 'Ubiquiti',
|
|
|
'ubnt' : 'UBNT',
|
|
|
'vocore' : 'Vocore',
|
|
|
'wd-my-net' : 'WD My Net',
|
|
|
'x86' : 'x86',
|
|
|
+ 'xiaomi' : 'Xiaomi',
|
|
|
'zbt' : 'ZBT',
|
|
|
'zyxel' : 'Zyxel'
|
|
|
}
|
|
@@ -66,7 +86,7 @@ def longestPrefixKeyMatch(string, dictionary):
|
|
|
|
|
|
def vendorPP(vendor):
|
|
|
if vendor in VENDORS:
|
|
|
- return VENDORS[vendor]
|
|
|
+ return VENDORS[vendor]
|
|
|
else:
|
|
|
return vendor
|
|
|
|
|
@@ -85,7 +105,7 @@ def findFiles(directory):
|
|
|
m = re.search(pattern, f)
|
|
|
if m:
|
|
|
# extract info from filename
|
|
|
- file = m.group(0)
|
|
|
+ file = m.group(0)
|
|
|
firmware = m.group(3)
|
|
|
imageversion = m.group(1)
|
|
|
imagetype = m.group(4)
|
|
@@ -102,7 +122,7 @@ def findFiles(directory):
|
|
|
if model in BLACKLIST_MODELS:
|
|
|
continue
|
|
|
|
|
|
- vendor = vendorPP(vendor)
|
|
|
+ vendor = vendorPP(vendor)
|
|
|
entry = {'vendor' : vendor,
|
|
|
'model' : model,
|
|
|
'file' : file
|
|
@@ -127,4 +147,4 @@ if __name__ == "__main__":
|
|
|
with open(args.outputfile, "w") as fd:
|
|
|
json.dump(data, fd, sort_keys=True)
|
|
|
else:
|
|
|
- print json.dumps(data, sort_keys=True)
|
|
|
+ print(json.dumps(data, sort_keys=True))
|