def tcp_traceflow(frame, *, data_link):
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>protocol=data_link,                     <EOL>index=frame.info.number,                <EOL>frame=frame.info,                       <EOL>syn=tcp.flags.syn,                      <EOL>fin=tcp.flags.fin,                      <EOL>src=ip.src,                             <EOL>dst=ip.dst,                             <EOL>srcport=tcp.srcport,                    <EOL>dstport=tcp.dstport,                    <EOL>timestamp=frame.info.time_epoch,        <EOL>)<EOL>return True, data<EOL><DEDENT>return False, None<EOL>
Trace packet flow for TCP.