summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <imuwoto@gmail.com>2015-07-04 01:39:49 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-04 14:22:40 +0900
commit2cc542c4d7cab7684f1704735fff8bc84d53f17b (patch)
treefbf077b0abc0975dd10539fe6459b43aa068293b
parentecd1e4209addce1754505f9c52a4ecb980fe20ed (diff)
Implement NX Resubmit-table action
Signed-off-by: YAMAMOTO Takashi <imuwoto@gmail.com> Tested-by: Gal Sagie <gal.sagie@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/nx_actions.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/ryu/ofproto/nx_actions.py b/ryu/ofproto/nx_actions.py
index 4a955389..cc9c3f8e 100644
--- a/ryu/ofproto/nx_actions.py
+++ b/ryu/ofproto/nx_actions.py
@@ -380,6 +380,41 @@ def generate(ofp_name, ofpp_name):
msg_pack_into('!%ds' % len(data), buf, offset + payload_offset,
bytes(data))
+ class NXActionResubmitTable(NXAction):
+ _subtype = nicira_ext.NXAST_RESUBMIT_TABLE
+
+ # in_port, table_id
+ _fmt_str = '!HB3x'
+
+ def __init__(self,
+ in_port,
+ table_id,
+ type_=None, len_=None, experimenter=None, subtype=None):
+ super(NXActionResubmitTable, self).__init__()
+ self.in_port = in_port
+ self.table_id = table_id
+
+ @classmethod
+ def parse(cls, buf):
+ (in_port,
+ table_id) = struct.unpack_from(
+ NXActionResubmitTable._fmt_str, buf, 0)
+ return cls(in_port, table_id)
+
+ def serialize(self, buf, offset):
+ data = bytearray()
+ msg_pack_into(NXActionResubmitTable._fmt_str, data, 0,
+ self.in_port,
+ self.table_id)
+ payload_offset = (
+ ofp.OFP_ACTION_EXPERIMENTER_HEADER_SIZE +
+ struct.calcsize(NXAction._fmt_str)
+ )
+ self.len = utils.round_up(payload_offset + len(data), 8)
+ super(NXActionResubmitTable, self).serialize(buf, offset)
+ msg_pack_into('!%ds' % len(data), buf, offset + payload_offset,
+ bytes(data))
+
def add_attr(k, v):
v.__module__ = ofpp.__name__ # Necessary for stringify stuff
setattr(ofpp, k, v)
@@ -391,6 +426,7 @@ def generate(ofp_name, ofpp_name):
'NXActionRegMove',
'NXActionLearn',
'NXActionConjunction',
+ 'NXActionResubmitTable',
'_NXFlowSpec', # exported for testing
'NXFlowSpecMatch',
'NXFlowSpecLoad',