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:
parent
5a0eea61fa
commit
fd692d330d
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user