def analyse(file, length=None, *, _termination=False):
    """Analyse application layer packets."""
    seekset = file.tell()
    if not _termination:
        # FTP analysis
        flag, ftp = _analyse_ftp(file, length, seekset=seekset)
        if flag:
            return ftp

        # HTTP/1.* analysis
        flag, http = _analyse_httpv1(file, length, seekset=seekset)
        if flag:
            return http

        # NOTE: due to format similarity of HTTP/2 and TLS/SSL, HTTP/2 won't be analysed before TLS/SSL is implemented.
        # NB: the NOTE above is deprecated, since validations are performed

        # HTTP/2 analysis
        flag, http = _analyse_httpv2(file, length, seekset=seekset)
        if flag:
            return http

        # backup file offset
        file.seek(seekset, os.SEEK_SET)

    # raw packet analysis
    return Raw(file, length)
Analyse application layer packets.