1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

traffic: give Packet __slots__ for reduced memory

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-10-19 16:51:22 +13:00 committed by Douglas Bagnall
parent 4f7ae5d925
commit 24d09d1df8

View File

@ -156,9 +156,18 @@ class FakePacketError(Exception):
class Packet(object):
"""Details of a network packet"""
__slots__ = ('timestamp',
'ip_protocol',
'stream_number',
'src',
'dest',
'protocol',
'opcode',
'desc',
'extra',
'endpoints')
def __init__(self, timestamp, ip_protocol, stream_number, src, dest,
protocol, opcode, desc, extra):
self.timestamp = timestamp
self.ip_protocol = ip_protocol
self.stream_number = stream_number