diff options
author | Simon Horman <horms@verge.net.au> | 2014-01-29 12:05:59 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-01-29 12:42:54 +0900 |
commit | 2235def21b1b4b1e7662cd937a0e8bbee0162094 (patch) | |
tree | 6a6671cc43d805bb464aed3ea280372e0e199abd | |
parent | bb65f94a071d592dfa215ee52c5a4c70668b6cde (diff) |
Add OF1.4 PushPbb action support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 5b2ab643..08d89b9a 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -2485,6 +2485,35 @@ class OFPActionSetField(OFPAction): yield (self.key, self.value) +@OFPAction.register_action_type(ofproto.OFPAT_PUSH_PBB, + ofproto.OFP_ACTION_PUSH_SIZE) +class OFPActionPushPbb(OFPAction): + """ + Push PBB action + + This action pushes a new PBB header to the packet. + + ================ ====================================================== + Attribute Description + ================ ====================================================== + ethertype Ether type + ================ ====================================================== + """ + def __init__(self, ethertype, type_=None, len_=None): + super(OFPActionPushPbb, self).__init__() + self.ethertype = ethertype + + @classmethod + def parser(cls, buf, offset): + (type_, len_, ethertype) = struct.unpack_from( + ofproto.OFP_ACTION_PUSH_PACK_STR, buf, offset) + return cls(ethertype) + + def serialize(self, buf, offset): + msg_pack_into(ofproto.OFP_ACTION_PUSH_PACK_STR, buf, offset, + self.type, self.len, self.ethertype) + + @OFPAction.register_action_type(ofproto.OFPAT_POP_PBB, ofproto.OFP_ACTION_HEADER_SIZE) class OFPActionPopPbb(OFPAction): |