code: def _parse_zebra_family_prefix(buf):
      
      (family,) = struct.unpack_from(_ZEBRA_FAMILY_FMT, buf)
      rest = buf[_ZEBRA_FAMILY_SIZE:]
  
      if socket.AF_INET == family:
          (prefix, p_len) = struct.unpack_from(_ZEBRA_IPV4_PREFIX_FMT, rest)
          prefix = '%s/%d' % (addrconv.ipv4.bin_to_text(prefix), p_len)
          rest = rest[_ZEBRA_IPV4_PREFIX_SIZE:]
      elif socket.AF_INET6 == family:
          (prefix, p_len) = struct.unpack_from(_ZEBRA_IPV6_PREFIX_FMT, rest)
          prefix = '%s/%d' % (addrconv.ipv6.bin_to_text(prefix), p_len)
          rest = rest[_ZEBRA_IPV6_PREFIX_SIZE:]
      else:
          raise struct.error('Unsupported family: %d' % family)
  
      return family, prefix, rest
docs: Parses family and prefix in Zebra format.