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

Function sendp

scapy/sendrecv.py:501–531  ·  view source on GitHub ↗

Send packets at layer 2 :param x: the packets :param inter: time (in s) between two packets (default 0) :param loop: send packet indefinitely (default 0) :param count: number of packets to send (default None=1) :param verbose: verbose mode (default None=conf.verb) :para

(x,  # type: _PacketIterable
          iface=None,  # type: Optional[_GlobInterfaceType]
          iface_hint=None,  # type: Optional[str]
          socket=None,  # type: Optional[SuperSocket]
          **kargs  # type: Any
          )

Source from the content-addressed store, hash-verified

499
500@conf.commands.register
501def sendp(x, # type: _PacketIterable
502 iface=None, # type: Optional[_GlobInterfaceType]
503 iface_hint=None, # type: Optional[str]
504 socket=None, # type: Optional[SuperSocket]
505 **kargs # type: Any
506 ):
507 # type: (...) -> Optional[PacketList]
508 """
509 Send packets at layer 2
510
511 :param x: the packets
512 :param inter: time (in s) between two packets (default 0)
513 :param loop: send packet indefinitely (default 0)
514 :param count: number of packets to send (default None=1)
515 :param verbose: verbose mode (default None=conf.verb)
516 :param realtime: check that a packet was sent before sending the next one
517 :param return_packets: return the sent packets
518 :param socket: the socket to use (default is conf.L3socket(kargs))
519 :param iface: the interface to send the packets on
520 :param monitor: (not on linux) send in monitor mode
521 :returns: None
522 """
523 if iface is None and iface_hint is not None and socket is None:
524 iface = conf.route.route(iface_hint)[0]
525 return _send(
526 x,
527 lambda iface: iface.l2socket(),
528 iface=iface,
529 socket=socket,
530 **kargs
531 )
532
533
534@conf.commands.register

Callers 9

negotiate_trunkFunction · 0.90
arpcachepoisonFunction · 0.90
arp_mitmFunction · 0.90
ns_reply_callbackFunction · 0.90
na_reply_callbackFunction · 0.90
reply_callbackFunction · 0.90
NDP_Attack_NS_SpoofingFunction · 0.90
ra_reply_callbackFunction · 0.90
send_replyMethod · 0.90

Calls 3

_sendFunction · 0.85
l2socketMethod · 0.80
routeMethod · 0.45

Tested by

no test coverage detected