Update info about a network interface according to a given dictionary. Such data is provided by get_windows_if_list
(self, data)
| 329 | super(NetworkInterface_Win, self).__init__(provider, data) |
| 330 | |
| 331 | def update(self, data): |
| 332 | # type: (Dict[str, Any]) -> None |
| 333 | """Update info about a network interface according |
| 334 | to a given dictionary. Such data is provided by get_windows_if_list |
| 335 | """ |
| 336 | # Populated early because used below |
| 337 | self.network_name = data['network_name'] |
| 338 | # Windows specific |
| 339 | self.guid = data['guid'] |
| 340 | self.ipv4_metric = data['ipv4_metric'] |
| 341 | self.ipv6_metric = data['ipv6_metric'] |
| 342 | self.nameservers = data['nameservers'] |
| 343 | |
| 344 | try: |
| 345 | # Npcap loopback interface |
| 346 | if conf.use_npcap and self.network_name == conf.loopback_name: |
| 347 | # https://nmap.org/npcap/guide/npcap-devguide.html |
| 348 | data["mac"] = "00:00:00:00:00:00" |
| 349 | data["ip"] = "127.0.0.1" |
| 350 | data["ip6"] = "::1" |
| 351 | data["ips"] = ["127.0.0.1", "::1"] |
| 352 | except KeyError: |
| 353 | pass |
| 354 | super(NetworkInterface_Win, self).update(data) |
| 355 | |
| 356 | def _check_npcap_requirement(self): |
| 357 | # type: () -> None |
no outgoing calls
no test coverage detected