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