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

Function sr

scapy/sendrecv.py:692–721  ·  view source on GitHub ↗

Send and receive packets at layer 3 This determines the interface (or L2 source to use) based on the routing table: conf.route / conf.route6

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

Source from the content-addressed store, hash-verified

690
691@conf.commands.register
692def sr(x, # type: _PacketIterable
693 promisc=None, # type: Optional[bool]
694 filter=None, # type: Optional[str]
695 nofilter=0, # type: int
696 *args, # type: Any
697 **kargs # type: Any
698 ):
699 # type: (...) -> Tuple[SndRcvList, PacketList]
700 """
701 Send and receive packets at layer 3
702
703 This determines the interface (or L2 source to use) based on the routing
704 table: conf.route / conf.route6
705 """
706 if "iface" in kargs:
707 # Warn that it isn't used.
708 warnings.warn(
709 "'iface' has no effect on L3 I/O sr(). For multicast/link-local "
710 "see https://scapy.readthedocs.io/en/latest/usage.html#multicast",
711 SyntaxWarning,
712 )
713 del kargs["iface"]
714 iface, ipv6 = _interface_selection(x)
715 s = iface.l3socket(ipv6)(
716 promisc=promisc, filter=filter,
717 iface=iface, nofilter=nofilter,
718 )
719 result = sndrcv(s, x, *args, **kargs)
720 s.close()
721 return result
722
723
724@conf.commands.register

Callers 10

ikev2scanFunction · 0.90
nmap_sigFunction · 0.90
dnssdFunction · 0.90
fullinfosMethod · 0.90
tracerouteFunction · 0.90
report_portsFunction · 0.90
traceroute6Function · 0.90
ikescanFunction · 0.90
sr1Function · 0.85
latency_router.pyFile · 0.85

Calls 4

_interface_selectionFunction · 0.85
sndrcvFunction · 0.85
l3socketMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected