import struct


def in6_getnsmac(a): # return multicast Ethernet address associated with multicast v6 destination
    """
    Return the multicast mac address associated with provided
    IPv6 address. Passed address must be in network format. 
    """

    a = struct.unpack('16B', a)[-4:]
    mac = '33:33:'
    mac += ':'.join(map(lambda x: '%.2x' %x, a))
    return mac