def neighsol(addr, src, iface, timeout=1, chainCC=0):
 nsma = in6_getnsma(inet_pton(socket.AF_INET6, addr))
 d = inet_ntop(socket.AF_INET6, nsma)
 dm = in6_getnsmac(nsma)
 p = (Ether(dst=dm) / IPv6(dst=d, src=src, hlim=255))
 p /= ICMPv6ND_NS(tgt=addr)
 p /= ICMPv6NDOptSrcLLAddr(lladdr=get_if_hwaddr(iface))
 res = srp1(p, type=ETH_P_IPV6, iface=iface, timeout=1, verbose=0, chainCC=chainCC)
 return res

def neighsol ( addr , src , iface , timeout = 1 , chainCC = 0 ) : nsma = in6_getnsma ( inet_pton ( socket . AF_INET6 , addr ) ) d = inet_ntop ( socket . AF_INET6 , nsma ) dm = in6_getnsmac ( nsma ) p = ( Ether ( dst = dm ) / IPv6 ( dst = d , src = src , hlim = 255 ) ) p /= ICMPv6ND_NS ( tgt = addr ) p /= ICMPv6NDOptSrcLLAddr ( lladdr = get_if_hwaddr ( iface ) ) res = srp1 ( p , type = ETH_P_IPV6 , iface = iface , timeout = 1 , verbose = 0 , chainCC = chainCC ) return res
sends an icmpv6 neighbor solicitation message to get the mac address of the neighbor with specified ipv6 address addr .