1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 05:01:29 +00:00

Make osclasses a substructure of osmatch.

This commit is contained in:
david
2012-05-05 18:02:41 +00:00
parent 56b7063aa9
commit cac71422e8
7 changed files with 68 additions and 76 deletions

View File

@@ -148,8 +148,11 @@ if pixmap_path:
iconfactory.add_default()
def get_os_icon(host):
osclass = host.get_best_osclass()
osmatch = host.get_best_osmatch()
if osmatch and osmatch['osclasses']:
osclass = osmatch['osclasses'][0]
else:
osclass = None
if osclass and osmatch:
return get_os(osclass['osfamily'], osmatch['name'], 'icon')
@@ -157,8 +160,11 @@ def get_os_icon(host):
return get_os(None, None, 'icon')
def get_os_logo(host):
osclass = host.get_best_osclass()
osmatch = host.get_best_osmatch()
if osmatch and osmatch['osclasses']:
osclass = osmatch['osclasses'][0]
else:
osclass = None
if osclass and osmatch:
return get_os(osclass['osfamily'], osmatch['name'], 'logo')