From bb65f94a071d592dfa215ee52c5a4c70668b6cde Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 29 Jan 2014 12:05:58 +0900 Subject: [PATCH] Add OF1.4 PopPbb action support Signed-off-by: Simon Horman Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_4_parser.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 3f73e803..5b2ab643 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -2483,3 +2483,28 @@ class OFPActionSetField(OFPAction): def stringify_attrs(self): yield (self.key, self.value) + + +@OFPAction.register_action_type(ofproto.OFPAT_POP_PBB, + ofproto.OFP_ACTION_HEADER_SIZE) +class OFPActionPopPbb(OFPAction): + """ + Pop PBB action + + This action pops the outermost PBB service instance header from + the packet. + """ + def __init__(self, type_=None, len_=None): + super(OFPActionPopPbb, self).__init__() + + @classmethod + def parser(cls, buf, offset): + (type_, len_) = struct.unpack_from( + ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset) + return cls() + + @classmethod + def parser(cls, buf, offset): + (type_, len_) = struct.unpack_from( + ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset) + return cls()