mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 13:56:09 +02:00
of13: Added InstructionMeter
Signed-off-by: Philipp Aeschlimann <aepp@zhaw.ch> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
df42ae87e8
commit
727d7bd356
@ -1589,6 +1589,26 @@ class OFPInstructionActions(object):
|
||||
buf, offset, self.type, self.len)
|
||||
|
||||
|
||||
@OFPInstruction.register_instruction_type([ofproto_v1_3.OFPIT_METER])
|
||||
class OFPInstructionMeter(object):
|
||||
def __init__(self, meter_id):
|
||||
super(OFPInstructionMeter, self).__init__()
|
||||
self.type = ofproto_v1_3.OFPIT_METER
|
||||
self.len = ofproto_v1_3.OFP_INSTRUCTION_METER_SIZE
|
||||
self.meter_id = meter_id
|
||||
|
||||
@classmethod
|
||||
def parser(cls, buf, offset):
|
||||
(type_, len_, table_id) = struct.unpack_from(
|
||||
ofproto_v1_3.OFP_INSTRUCTION_METER_PACK_STR,
|
||||
buf, offset)
|
||||
return cls(meter_id)
|
||||
|
||||
def serialize(self, buf, offset):
|
||||
msg_pack_into(ofproto_v1_3.OFP_INSTRUCTION_METER_PACK_STR,
|
||||
buf, offset, self.type, self.len, self.meter_id)
|
||||
|
||||
|
||||
class OFPActionHeader(object):
|
||||
def __init__(self, type_, len_):
|
||||
self.type = type_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user