def tcp_traceflow(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>protocol=LINKTYPE.get(packet.name.upper()),     <EOL>index=count,                                    <EOL>frame=packet2dict(packet),                      <EOL>syn=bool(tcp.flags.S),                          <EOL>fin=bool(tcp.flags.F),                          <EOL>src=ipaddress.ip_address(ip.src),               <EOL>dst=ipaddress.ip_address(ip.dst),               <EOL>srcport=tcp.sport,                              <EOL>dstport=tcp.dport,                              <EOL>timestamp=time.time(),                          <EOL>)<EOL>return True, data<EOL><DEDENT>return False, None<EOL>
Trace packet flow for TCP.