def from_dict(self, msg_dict):
'''Converts the entry back to dict format'''
self.timestamp = msg_dict['timestamp']
self.proto = ndr.PortProtocols(msg_dict['proto'])
self.src = ipaddress.ip_address(msg_dict['src'])
if msg_dict['srcport'] is not None:
self.srcport = int(msg_dict['srcport'])
self.dst = ipaddress.ip_address(msg_dict['dst'])
if msg_dict['dstport'] is not None:
self.dstport = int(msg_dict['dstport'])
self.ethsrc = msg_dict['ethsrc']
self.ethdst = msg_dict['ethdst']
self.ethlen = int(msg_dict['ethlen'])
self.tcpflags = msg_dict['tcpflags']
if 'tcpseq' is not None:
self.tcpseq = msg_dict['tcpseq']
else:
self.tcpseq = None
评论列表
文章目录