def getmacbyip6(ip6, chainCC=0):
 if in6_ismaddr(ip6):
  mac = in6_getnsmac(inet_pton(socket.AF_INET6, ip6))
  return mac
 (iff, a, nh) = conf.route6.route(ip6, dev=conf.iface6)
 if (iff == LOOPBACK_NAME):
  return 'ff:ff:ff:ff:ff:ff'
 if (nh != '::'):
  ip6 = nh
 mac = conf.netcache.in6_neighbor.get(ip6)
 if mac:
  return mac
 res = neighsol(ip6, a, iff, chainCC=chainCC)
 if (res is not None):
  mac = res.src
  conf.netcache.in6_neighbor[ip6] = mac
  return mac
 return None

def getmacbyip6 ( ip6 , chainCC = 0 ) : if in6_ismaddr ( ip6 ) : mac = in6_getnsmac ( inet_pton ( socket . AF_INET6 , ip6 ) ) return mac ( iff , a , nh ) = conf . route6 . route ( ip6 , dev = conf . iface6 ) if ( iff == LOOPBACK_NAME ) : return 'ff:ff:ff:ff:ff:ff' if ( nh != '::' ) : ip6 = nh mac = conf . netcache . in6_neighbor . get ( ip6 ) if mac : return mac res = neighsol ( ip6 , a , iff , chainCC = chainCC ) if ( res is not None ) : mac = res . src conf . netcache . in6_neighbor [ ip6 ] = mac return mac return None
returns the mac address to be used for provided ip6 peer .