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

Function _tups

scapy/layers/l2.py:942–953  ·  view source on GitHub ↗
(ip, mac)

Source from the content-addressed store, hash-verified

940 target_mac = get_if_hwaddr(iface)
941
942 def _tups(ip, mac):
943 # type: (str, Optional[Union[str, List[str]]]) -> Iterable[Tuple[str, str]]
944 if mac is None:
945 if broadcast:
946 # ip can be a Net/list/etc and will be iterated upon while sending
947 return [(ip, "ff:ff:ff:ff:ff:ff")]
948 return [(x.query.pdst, x.answer.hwsrc)
949 for x in arping(ip, verbose=0, iface=iface)[0]]
950 elif isinstance(mac, list):
951 return [(ip, x) for x in mac]
952 else:
953 return [(ip, mac)]
954
955 tup1 = _tups(ip1, mac1)
956 if not tup1:

Callers 1

arp_mitmFunction · 0.85

Calls 1

arpingFunction · 0.85

Tested by

no test coverage detected