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

Class ARPingResult

scapy/layers/l2.py:1020–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018
1019
1020class ARPingResult(SndRcvList):
1021 def __init__(self,
1022 res=None, # type: Optional[Union[_PacketList[QueryAnswer], List[QueryAnswer]]] # noqa: E501
1023 name="ARPing", # type: str
1024 stats=None # type: Optional[List[Type[Packet]]]
1025 ):
1026 SndRcvList.__init__(self, res, name, stats)
1027
1028 def show(self, *args, **kwargs):
1029 # type: (*Any, **Any) -> None
1030 """
1031 Print the list of discovered MAC addresses.
1032 """
1033 data = list() # type: List[Tuple[str | List[str], ...]]
1034
1035 for s, r in self.res:
1036 manuf = conf.manufdb._get_short_manuf(r.src)
1037 manuf = "unknown" if manuf == r.src else manuf
1038 data.append((r[Ether].src, manuf, r[ARP].psrc))
1039
1040 print(
1041 pretty_list(
1042 data,
1043 [("src", "manuf", "psrc")],
1044 sortBy=2,
1045 )
1046 )
1047
1048
1049@conf.commands.register

Callers 2

arpingFunction · 0.85
promiscpingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected