mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 13:56:09 +02:00
packet lib: packet class accepts protocols list argument
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
00261be526
commit
da5c7f13cf
@ -31,10 +31,13 @@ class Packet(object):
|
||||
*data* should be omitted when encoding a packet.
|
||||
"""
|
||||
|
||||
def __init__(self, data=None, parse_cls=ethernet.ethernet):
|
||||
def __init__(self, data=None, protocols=None, parse_cls=ethernet.ethernet):
|
||||
super(Packet, self).__init__()
|
||||
self.data = data
|
||||
self.protocols = []
|
||||
if protocols is None:
|
||||
self.protocols = []
|
||||
else:
|
||||
self.protocols = protocols
|
||||
self.protocol_idx = 0
|
||||
self.parsed_bytes = 0
|
||||
if self.data:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user