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

Function send

scapy/sendrecv.py:462–497  ·  view source on GitHub ↗

Send packets at layer 3 This determines the interface (or L2 source to use) based on the routing table: conf.route / conf.route6 :param x: the packets :param inter: time (in s) between two packets (default 0) :param loop: send packet indefinitely (default 0) :param cou

(x,  # type: _PacketIterable
         **kargs  # type: Any
         )

Source from the content-addressed store, hash-verified

460
461@conf.commands.register
462def send(x, # type: _PacketIterable
463 **kargs # type: Any
464 ):
465 # type: (...) -> Optional[PacketList]
466 """
467 Send packets at layer 3
468
469 This determines the interface (or L2 source to use) based on the routing
470 table: conf.route / conf.route6
471
472 :param x: the packets
473 :param inter: time (in s) between two packets (default 0)
474 :param loop: send packet indefinitely (default 0)
475 :param count: number of packets to send (default None=1)
476 :param verbose: verbose mode (default None=conf.verb)
477 :param realtime: check that a packet was sent before sending the next one
478 :param return_packets: return the sent packets
479 :param socket: the socket to use (default is conf.L3socket(kargs))
480 :param monitor: (not on linux) send in monitor mode
481 :returns: None
482 """
483 if "iface" in kargs:
484 # Warn that it isn't used.
485 warnings.warn(
486 "'iface' has no effect on L3 I/O send(). For multicast/link-local "
487 "see https://scapy.readthedocs.io/en/latest/usage.html#multicast",
488 SyntaxWarning,
489 )
490 del kargs["iface"]
491 iface, ipv6 = _interface_selection(x)
492 return _send(
493 x,
494 lambda iface: iface.l3socket(ipv6),
495 iface=iface,
496 **kargs
497 )
498
499
500@conf.commands.register

Callers

nothing calls this directly

Calls 3

_interface_selectionFunction · 0.85
_sendFunction · 0.85
l3socketMethod · 0.80

Tested by

no test coverage detected