def tcp_reassembly(frame):
if '<STR_LIT>' in frame:<EOL><INDENT>ip = (frame['<STR_LIT>'] if '<STR_LIT>' in frame else frame['<STR_LIT>']).info<EOL>tcp = frame['<STR_LIT>'].info<EOL>data = dict(<EOL>bufid=(<EOL>ip.src,                                     <EOL>ip.dst,                                     <EOL>tcp.srcport,                                <EOL>tcp.dstport,                                <EOL>),<EOL>num=frame.info.number,                          <EOL>ack=tcp.ack,                                    <EOL>dsn=tcp.seq,                                    <EOL>syn=tcp.flags.syn,                              <EOL>fin=tcp.flags.fin,                              <EOL>rst=tcp.flags.rst,                              <EOL>payload=bytearray(tcp.packet.payload or b'<STR_LIT>'),   <EOL>)<EOL>raw_len = len(data['<STR_LIT>'])                      <EOL>data['<STR_LIT>'] = tcp.seq                             <EOL>data['<STR_LIT>'] = tcp.seq + raw_len                    <EOL>data['<STR_LIT>'] = raw_len                               <EOL>return True, data<EOL><DEDENT>return False, None<EOL>
Make data for TCP reassembly.