MCPcopy Index your code
hub / github.com/secdev/scapy / _resolve_ips

Function _resolve_ips

scapy/arch/windows/__init__.py:258–277  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

256 return str2mac(bytes(data)[:size])
257
258 def _resolve_ips(y):
259 # type: (List[Dict[str, Any]]) -> List[str]
260 if not isinstance(y, list):
261 return []
262 ips = []
263 for ip in y:
264 addr = ip['address']['address'].contents
265 if addr.si_family == socket.AF_INET6:
266 ip_key = "Ipv6"
267 si_key = "sin6_addr"
268 else:
269 ip_key = "Ipv4"
270 si_key = "sin_addr"
271 data = getattr(addr, ip_key)
272 data = getattr(data, si_key)
273 data = bytes(bytearray(data.byte))
274 # Build IP
275 if data:
276 ips.append(inet_ntop(addr.si_family, data))
277 return ips
278
279 def _get_ips(x):
280 # type: (Dict[str, Any]) -> List[str]

Callers 2

_get_ipsFunction · 0.85
get_windows_if_listFunction · 0.85

Calls 2

inet_ntopFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected