def tcp_reassembly(packet, *, count=NotImplemented):
if '<STR_LIT>' in packet:<EOL><INDENT>ip = packet['<STR_LIT>'] if '<STR_LIT>' in packet else packet['<STR_LIT>']<EOL>tcp = packet['<STR_LIT>']<EOL>data = dict(<EOL>bufid=(<EOL>ipaddress.ip_address(ip.src),       <EOL>ipaddress.ip_address(ip.dst),       <EOL>tcp.sport,                          <EOL>tcp.dport,                          <EOL>),<EOL>num=count,                              <EOL>ack=tcp.ack,                            <EOL>dsn=tcp.seq,                            <EOL>syn=bool(tcp.flags.S),                  <EOL>fin=bool(tcp.flags.F),                  <EOL>rst=bool(tcp.flags.R),                  <EOL>payload=bytearray(bytes(tcp.payload)),  <EOL>)<EOL>raw_len = len(tcp.payload)                  <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>
Store data for TCP reassembly.