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

Function ns_reply_callback

scapy/layers/inet6.py:3660–3672  ·  view source on GitHub ↗

Callback that reply to a NS by sending a similar NS

(req, reply_mac, iface)

Source from the content-addressed store, hash-verified

3658 """
3659
3660 def ns_reply_callback(req, reply_mac, iface):
3661 """
3662 Callback that reply to a NS by sending a similar NS
3663 """
3664
3665 # Let's build a reply and send it
3666 mac = req[Ether].src
3667 dst = req[IPv6].dst
3668 tgt = req[ICMPv6ND_NS].tgt
3669 rep = Ether(src=reply_mac) / IPv6(src="::", dst=dst) / ICMPv6ND_NS(tgt=tgt) # noqa: E501
3670 sendp(rep, iface=iface, verbose=0)
3671
3672 print("Reply NS for target address %s (received from %s)" % (tgt, mac))
3673
3674 _NDP_Attack_DAD_DoS(ns_reply_callback, iface, mac_src_filter,
3675 tgt_filter, reply_mac)

Callers

nothing calls this directly

Calls 4

EtherClass · 0.90
sendpFunction · 0.90
IPv6Class · 0.85
ICMPv6ND_NSClass · 0.85

Tested by

no test coverage detected