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

Function srp

scapy/sendrecv.py:748–769  ·  view source on GitHub ↗

Send and receive packets at layer 2

(x,  # type: _PacketIterable
        promisc=None,  # type: Optional[bool]
        iface=None,  # type: Optional[_GlobInterfaceType]
        iface_hint=None,  # type: Optional[str]
        filter=None,  # type: Optional[str]
        nofilter=0,  # type: int
        type=ETH_P_ALL,  # type: int
        *args,  # type: Any
        **kargs  # type: Any
        )

Source from the content-addressed store, hash-verified

746
747@conf.commands.register
748def srp(x, # type: _PacketIterable
749 promisc=None, # type: Optional[bool]
750 iface=None, # type: Optional[_GlobInterfaceType]
751 iface_hint=None, # type: Optional[str]
752 filter=None, # type: Optional[str]
753 nofilter=0, # type: int
754 type=ETH_P_ALL, # type: int
755 *args, # type: Any
756 **kargs # type: Any
757 ):
758 # type: (...) -> Tuple[SndRcvList, PacketList]
759 """
760 Send and receive packets at layer 2
761 """
762 if iface is None and iface_hint is not None:
763 iface = conf.route.route(iface_hint)[0]
764 iface = resolve_iface(iface or conf.iface)
765 s = iface.l2socket()(promisc=promisc, iface=iface,
766 filter=filter, nofilter=nofilter, type=type)
767 result = sndrcv(s, x, *args, **kargs)
768 s.close()
769 return result
770
771
772@conf.commands.register

Callers 5

arpingFunction · 0.90
promiscpingFunction · 0.90
etherleakFunction · 0.90
arpleakFunction · 0.90
srp1Function · 0.85

Calls 5

resolve_ifaceFunction · 0.90
sndrcvFunction · 0.85
l2socketMethod · 0.80
routeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected