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

Method show

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

Print the list of discovered MAC addresses.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

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.95
promiscpingFunction · 0.95

Calls 3

pretty_listFunction · 0.90
_get_short_manufMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected