Signed-off-by: FUJITA Tomonori <[email protected]>
---
ryu/ofproto/ofproto_v1_0.py | 5 +++++
ryu/ofproto/ofproto_v1_0_parser.py | 22 ++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_0.py b/ryu/ofproto/ofproto_v1_0.py
index a42c075..a84f518 100644
--- a/ryu/ofproto/ofproto_v1_0.py
+++ b/ryu/ofproto/ofproto_v1_0.py
@@ -246,6 +246,7 @@ NXAST_BUNDLE_LOAD = 13
NXAST_RESUBMIT_TABLE = 14
NXAST_OUTPUT_REG = 15
NXAST_EXIT = 17
+NXAST_FIN_TIMEOUT = 19
NXAST_CONTROLLER = 20
NX_ACTION_RESUBMIT_PACK_STR = '!HHIHHB3x'
@@ -296,6 +297,10 @@ NX_ACTION_CONTROLLER_PACK_STR = '!HHIHHHBB'
NX_ACTION_CONTROLLER_SIZE = 16
assert calcsize(NX_ACTION_CONTROLLER_PACK_STR) == NX_ACTION_CONTROLLER_SIZE
+NX_ACTION_FIN_TIMEOUT_PACK_STR = '!HHIHHH2x'
+NX_ACTION_FIN_TIMEOUT_SIZE = 16
+assert calcsize(NX_ACTION_FIN_TIMEOUT_PACK_STR) == NX_ACTION_FIN_TIMEOUT_SIZE
+
NX_ACTION_HEADER_PACK_STR = '!HHIH6x'
NX_ACTION_HEADER_SIZE = 16
assert calcsize(NX_ACTION_HEADER_PACK_STR) == NX_ACTION_HEADER_SIZE
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
b/ryu/ofproto/ofproto_v1_0_parser.py
index 89a7f6e..c677094 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -787,6 +787,28 @@ class NXActionController(NXActionHeader):
return cls(max_len, controller_id, reason)
[email protected]_nx_action_subtype(ofproto_v1_0.NXAST_FIN_TIMEOUT)
+class NXActionFinTimeout(NXActionHeader):
+ def __init__(self, fin_idle_timeout, fin_hard_timeout):
+ super(NXActionFinTimeout, self).__init__(
+ ofproto_v1_0.NXAST_FIN_TIMEOUT,
+ ofproto_v1_0.NX_ACTION_FIN_TIMEOUT_SIZE)
+ self.fin_idle_timeout = fin_idle_timeout
+ self.fin_hard_timeout = fin_hard_timeout
+
+ def serialize(self, buf, offset):
+ msg_pack_into(ofproto_v1_0.NX_ACTION_FIN_TIMEOUT_PACK_STR, buf, offset,
+ self.type, self.len, self.vendor, self.subtype,
+ self.fin_idle_timeout, self.fin_hard_timeout)
+
+ @classmethod
+ def parser(cls, buf, offset):
+ (type_, len_, vendor, subtype, fin_idle_timeout,
+ fin_hard_timeout) = struct.unpack_from(
+ ofproto_v1_0.NX_ACTION_FIN_TIMEOUT_PACK_STR, buf, offset)
+ return cls(fin_idle_timeout, fin_hard_timeout)
+
+
class OFPDescStats(collections.namedtuple('OFPDescStats',
('mfr_desc', 'hw_desc', 'sw_desc', 'serial_num', 'dp_desc'))):
@classmethod
--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel