mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
Make osclasses a substructure of osmatch.
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -140,7 +140,6 @@ class HostDetails(HIGVBox):
|
||||
os = host.get_best_osmatch()
|
||||
if os:
|
||||
os['portsused'] = host.get_ports_used()
|
||||
os['osclass'] = host.get_osclasses()
|
||||
|
||||
self.set_os(os)
|
||||
self.set_tcpseq(host.get_tcpsequence())
|
||||
@@ -154,7 +153,7 @@ class HostDetails(HIGVBox):
|
||||
self.hostnames_expander = gtk.Expander('<b>'+_('Hostnames')+'</b>')
|
||||
self.os_expander = gtk.Expander('<b>'+_('Operating System')+'</b>')
|
||||
self.portsused_expander = gtk.Expander('<b>'+_('Ports used')+'</b>')
|
||||
self.osclass_expander = gtk.Expander('<b>'+_('OS Class')+'</b>')
|
||||
self.osclass_expander = gtk.Expander('<b>'+_('OS Classes')+'</b>')
|
||||
self.tcp_expander = gtk.Expander('<b>'+_('TCP Sequence')+'</b>')
|
||||
self.ip_expander = gtk.Expander('<b>'+_('IP ID Sequence')+'</b>')
|
||||
self.tcpts_expander = gtk.Expander('<b>'+_('TCP TS Sequence')+'</b>')
|
||||
@@ -368,7 +367,7 @@ class HostDetails(HIGVBox):
|
||||
except:pass
|
||||
|
||||
try:
|
||||
self.set_osclass(os['osclass'])
|
||||
self.set_osclass(os['osclasses'])
|
||||
self.osclass_expander.set_use_markup(True)
|
||||
table.attach(self.osclass_expander,0,2,y1,y2)
|
||||
except:pass
|
||||
|
||||
Reference in New Issue
Block a user