def get_if_addr6(iff):
 for x in in6_getifaddr():
  if ((x[2] == iff) and (x[1] == IPV6_ADDR_GLOBAL)):
   return x[0]
 return None

def get_if_addr6 ( iff ) : for x in in6_getifaddr ( ) : if ( ( x [ 2 ] == iff ) and ( x [ 1 ] == IPV6_ADDR_GLOBAL ) ) : return x [ 0 ] return None
returns the main global unicast address associated with provided interface .