Fetch real advanced vulnerability scanner data.
(self)
| 1120 | if eth is None and eth_list: |
| 1121 | eth = eth_list[0] |
| 1122 | |
| 1123 | gw_ip = nd._default_gateway() |
| 1124 | gateway = {'ip': gw_ip, 'ptr': nd._reverse_dns(gw_ip) if gw_ip else None} |
| 1125 | _, nameservers, _ = nd._read_resolv_conf() |
| 1126 | |
| 1127 | lldp = {'installed': True, 'neighbor': None} |
| 1128 | res = nd.do_lldp() |
| 1129 | if not res.get('success'): |
| 1130 | if res.get('missing_tool'): |
| 1131 | lldp['installed'] = False |
| 1132 | else: |
| 1133 | neighbors = res.get('neighbors') or [] |
| 1134 | if eth: |
| 1135 | lldp['neighbor'] = next( |
| 1136 | (n for n in neighbors if n.get('local_interface') == eth.get('name')), None) |
| 1137 | if lldp['neighbor'] is None and neighbors: |
| 1138 | lldp['neighbor'] = neighbors[0] |
| 1139 | return {'eth': eth, 'eth_count': len(eth_list), |
| 1140 | 'gateway': gateway, 'dns': nameservers, 'lldp': lldp} |
| 1141 |
nothing calls this directly
no test coverage detected