def analyse(file, length=None, *, _termination=False):
seekset = file.tell()<EOL>if not _termination:<EOL><INDENT>flag, ftp = _analyse_ftp(file, length, seekset=seekset)<EOL>if flag:<EOL><INDENT>return ftp<EOL><DEDENT>flag, http = _analyse_httpv1(file, length, seekset=seekset)<EOL>if flag:<EOL><INDENT>return http<EOL><DEDENT>flag, http = _analyse_httpv2(file, length, seekset=seekset)<EOL>if flag:<EOL><INDENT>return http<EOL><DEDENT>file.seek(seekset, os.SEEK_SET)<EOL><DEDENT>return Raw(file, length)<EOL>
Analyse application layer packets.