Signed-off-by: FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp>
---
 ryu/ofproto/ofproto_v1_0.py        |    6 ++++++
 ryu/ofproto/ofproto_v1_0_parser.py |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_0.py b/ryu/ofproto/ofproto_v1_0.py
index ce8a09f..55350ce 100644
--- a/ryu/ofproto/ofproto_v1_0.py
+++ b/ryu/ofproto/ofproto_v1_0.py
@@ -571,6 +571,7 @@ NXT_ROLE_REQUEST = 10
 NXT_ROLE_REPLY = 11
 NXT_SET_FLOW_FORMAT = 12
 NXT_FLOW_MOD = 13
+NXT_FLOW_REMOVED = 14
 NXT_FLOW_MOD_TABLE_ID = 15
 NXT_SET_CONTROLLER_ID = 20
 
@@ -603,6 +604,11 @@ NX_SET_FLOW_FORMAT_SIZE = 20
 assert (calcsize(NX_SET_FLOW_FORMAT_PACK_STR) +
                  NICIRA_HEADER_SIZE == NX_SET_FLOW_FORMAT_SIZE)
 
+NX_FLOW_REMOVED_PACK_STR = '!QHBxIIHHQQ'
+NX_FLOW_REMOVED_SIZE = 56
+assert (calcsize(NX_FLOW_REMOVED_PACK_STR) +
+                 NICIRA_HEADER_SIZE == NX_FLOW_REMOVED_SIZE)
+
 NX_FLOW_MOD_TABLE_ID_PACK_STR = '!B7x'
 NX_FLOW_MOD_TABLE_ID_SIZE = 24
 assert (calcsize(NX_FLOW_MOD_TABLE_ID_PACK_STR) +
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py 
b/ryu/ofproto/ofproto_v1_0_parser.py
index 9cc7eee..82e17a0 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -1323,6 +1323,38 @@ class NXTFlowModTableId(NiciraHeader):
                       self.set)
 
 
+@NiciraHeader.register_nx_subtype(ofproto_v1_0.NXT_FLOW_REMOVED)
+class NXTFlowRemoved(NiciraHeader):
+    def __init__(self, datapath, cookie, priority, reason,
+                 duration_sec, duration_nsec, idle_timeout, match_len,
+                 packet_count, byte_count, match):
+        super(NXTFlowRemoved, self).__init__(
+            datapath, ofproto_v1_0.NXT_FLOW_REMOVED)
+        self.cookie = cookie
+        self.priority = priority
+        self.reason = reason
+        self.duration_sec = duration_sec
+        self.duration_nsec = duration_nsec
+        self.idle_timeout = idle_timeout
+        self.match_len = match_len
+        self.packet_count = packet_count
+        self.byte_count = byte_count
+        self.match = match
+
+    @classmethod
+    def parser(cls, datapath, buf, offset):
+        (cookie, priority, reason, duration_sec, duration_nsec,
+         idle_timeout, match_len,
+         packet_count, byte_count) = struct.unpack_from(
+            ofproto_v1_0.NX_FLOW_REMOVED_PACK_STR, buf, offset)
+        offset += (ofproto_v1_0.NX_FLOW_REMOVED_SIZE
+                   - ofproto_v1_0.NICIRA_HEADER_SIZE)
+        match = nx_match.NXMatch.parser(buf, offset, match_len)
+        return cls(datapath, cookie, priority, reason, duration_sec,
+                   duration_nsec, idle_timeout, match_len, packet_count,
+                   byte_count, match)
+
+
 class NXTSetControllerId(NiciraHeader):
     def __init__(self, datapath, controller_id):
         super(NXTSetControllerId, self).__init__(
-- 
1.7.4.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to