Signed-off-by: Yuichi Ito <[email protected]>
---
 ryu/ofproto/ofproto_v1_3_parser.py |   54 ++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_3_parser.py 
b/ryu/ofproto/ofproto_v1_3_parser.py
index 8d35db2..2b577d6 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -3016,6 +3016,60 @@ class OFPActionSetField(OFPAction):
         yield (self.key, self.value)


[email protected]_action_type(ofproto_v1_3.OFPAT_PUSH_PBB,
+                                ofproto_v1_3.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_v1_3.OFP_ACTION_PUSH_PACK_STR, buf, offset)
+        return cls(ethertype)
+
+    def serialize(self, buf, offset):
+        msg_pack_into(ofproto_v1_3.OFP_ACTION_PUSH_PACK_STR, buf, offset,
+                      self.type, self.len, self.ethertype)
+
+
[email protected]_action_type(ofproto_v1_3.OFPAT_POP_PBB,
+                                ofproto_v1_3.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_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+        return cls()
+
+    @classmethod
+    def parser(cls, buf, offset):
+        (type_, len_) = struct.unpack_from(
+            ofproto_v1_3.OFP_ACTION_HEADER_PACK_STR, buf, offset)
+        return cls()
+
+
 @OFPAction.register_action_type(
     ofproto_v1_3.OFPAT_EXPERIMENTER,
     ofproto_v1_3.OFP_ACTION_EXPERIMENTER_HEADER_SIZE)
-- 
1.7.10.4


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to