packet lib: set protocol_name in each protocol

With this, it's easy to know the protocol name.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
FUJITA Tomonori 2012-10-05 19:01:53 +09:00
parent 5fd538ee7f
commit 5a0eea61fa

View File

@ -28,6 +28,7 @@ class PacketBase(object):
def __init__(self): def __init__(self):
super(PacketBase, self).__init__() super(PacketBase, self).__init__()
self.length = 0 self.length = 0
self.protocol_name = self.__class__.__name__
@classmethod @classmethod
def parser(cls): def parser(cls):