docs: def dnsrepr2names(x):
      """
      Take as input a DNS encoded string (possibly compressed) 
      and returns a list of DNS names contained in it.
      If provided string is already in printable format
      (does not end with a null character, a one element list
      is returned). Result is a list.
      """
      res = []
      cur = b""
      if type(x) is str:
          x = x.encode('ascii')
      while x:
          #l = ord(x[0])
          l = x[0]
          x = x[1:]
          if l == 0:
              if cur and cur[-1] == ord('.'):
                  cur = cur[:-1]
              res.append(cur)
              cur = b""
              #if x and ord(x[0]) == 0: # single component
              if x and x[0] == 0: # single component
                  x = x[1:]
              continue
          if l & 0xc0: # XXX TODO : work on that -- arno
              raise Exception("DNS message can't be compressed at this point!")
          else:
              cur += x[:l]+b"."
              x = x[l:]
      return res