def in6_addrtomac(addr):
 mask = inet_pton(socket.AF_INET6, '::ffff:ffff:ffff:ffff')
 x = in6_and(mask, inet_pton(socket.AF_INET6, addr))
 ifaceid = inet_ntop(socket.AF_INET6, x)[2:]
 return in6_ifaceidtomac(ifaceid)

def in6_addrtomac ( addr ) : mask = inet_pton ( socket . AF_INET6 , '::ffff:ffff:ffff:ffff' ) x = in6_and ( mask , inet_pton ( socket . AF_INET6 , addr ) ) ifaceid = inet_ntop ( socket . AF_INET6 , x ) [ 2 : ] return in6_ifaceidtomac ( ifaceid )
extract the mac address from provided address .