def is_client(_packet):
"""
SYN = 0x02
ACK = 0x10
:param _packet:
:return: source ip if client
"""
t = _packet[s.TCP]
if t.flags & 0x02 and not t.flags & 0x10:
return True
tcp = _packet.getlayer(s.TCP)
if tcp.sport > tcp.dport: # if the sport is higher then likely it is the client
return True
return False
# get delay average for session
评论列表
文章目录