()
return inet_ntop(socket.AF_INET6, '\xfd' + globalid + '\x00'*10)
Returns a pseudo-randomly generated Local Unique prefix. Function
    follows recommandation of Section 3.2.2 of RFC 4193 for prefix
    generation.
Returns a pseudo-randomly generated Local Unique prefix. Function
    follows recommandation of Section 3.2.2 of RFC 4193 for prefix
    generation.
Returns a pseudo - randomly generated Local Unique prefix . Function follows recommandation of Section 3 . 2 . 2 of RFC 4193 for prefix generation .
def in6_getLocalUniquePrefix():
    """
    Returns a pseudo-randomly generated Local Unique prefix. Function
    follows recommandation of Section 3.2.2 of RFC 4193 for prefix
    generation.
    """
    # Extracted from RFC 1305 (NTP) :
    # NTP timestamps are represented as a 64-bit unsigned fixed-point number, 
    # in seconds relative to 0h on 1 January 1900. The integer part is in the 
    # first 32 bits and the fraction part in the last 32 bits.

    # epoch = (1900, 1, 1, 0, 0, 0, 5, 1, 0) 
    # x = time.time()
    # from time import gmtime, strftime, gmtime, mktime
    # delta = mktime(gmtime(0)) - mktime(self.epoch)
    # x = x-delta

    tod = time.time() # time of day. Will bother with epoch later
    i = int(tod)
    j = int((tod - i)*(2**32))
    tod = struct.pack("!II", i,j)
    # TODO: Add some check regarding system address gathering
    rawmac = get_if_raw_hwaddr(conf.iface6)[1]
    mac = ":".join(map(lambda x: "%.02x" % ord(x), list(rawmac)))
    # construct modified EUI-64 ID
    eui64 = inet_pton(socket.AF_INET6, '::' + in6_mactoifaceid(mac))[8:] 
    import sha
    globalid = sha.new(tod+eui64).digest()[:5]
    return inet_ntop(socket.AF_INET6, '\xfd' + globalid + '\x00'*10)
def in6_getLocalUniquePrefix ( ) : # Extracted from RFC 1305 (NTP) : # NTP timestamps are represented as a 64-bit unsigned fixed-point number,  # in seconds relative to 0h on 1 January 1900. The integer part is in the  # first 32 bits and the fraction part in the last 32 bits. # epoch = (1900, 1, 1, 0, 0, 0, 5, 1, 0)  # x = time.time() # from time import gmtime, strftime, gmtime, mktime # delta = mktime(gmtime(0)) - mktime(self.epoch) # x = x-delta tod = time . time ( ) # time of day. Will bother with epoch later i = int ( tod ) j = int ( ( tod - i ) * ( 2 ** 32 ) ) tod = struct . pack ( "!II" , i , j ) # TODO: Add some check regarding system address gathering rawmac = get_if_raw_hwaddr ( conf . iface6 ) [ 1 ] mac = ":" . join ( map ( lambda x : "%.02x" % ord ( x ) , list ( rawmac ) ) ) # construct modified EUI-64 ID eui64 = inet_pton ( socket . AF_INET6 , '::' + in6_mactoifaceid ( mac ) ) [ 8 : ] import sha globalid = sha . new ( tod + eui64 ) . digest ( ) [ : 5 ] return inet_ntop ( socket . AF_INET6 , '\xfd' + globalid + '\x00' * 10 )