packet lib: kill find_protocol in Packet class

- Now easy to know the protocol name and iterate protocols.

- find_protocol doesn't handle the case the same protocols are stacked.

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

View File

@ -52,11 +52,6 @@ class Packet(object):
def add_protocol(self, proto):
self.protocols.append(proto)
def find_protocol(self, name):
for p in self.protocols:
if p.__class__.__name__ == name:
return p
def next(self):
try:
p = self.protocols[self.protocol_idx]