diff options
author | Simon Horman <horms@verge.net.au> | 2014-01-29 12:06:19 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-01-29 12:43:25 +0900 |
commit | e59f9acc16d1157b02e0a4badbd9aed00633a798 (patch) | |
tree | 647fdb5d9bc19840bd722bf599dd9255a4114200 | |
parent | 557af7f991a64297ec11021a896cfa362ce6fd15 (diff) |
Add OF1.4 table mod message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 0fc4ea7a..c5443c48 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -1612,6 +1612,41 @@ class OFPMultipartRequest(MsgBase): self._serialize_stats_body() +@_set_msg_type(ofproto.OFPT_TABLE_MOD) +class OFPTableMod(MsgBase): + """ + Flow table configuration message + + The controller sends this message to configure table state. + + ================ ====================================================== + Attribute Description + ================ ====================================================== + table_id ID of the table (OFPTT_ALL indicates all tables) + config Bitmap of the following flags. + OFPTC_DEPRECATED_MASK (3) + ================ ====================================================== + + Example:: + + def send_table_mod(self, datapath): + ofp = datapath.ofproto + ofp_parser = datapath.ofproto_parser + + req = ofp_parser.OFPTableMod(datapath, 1, 3) + datapath.send_msg(req) + """ + def __init__(self, datapath, table_id, config): + super(OFPTableMod, self).__init__(datapath) + self.table_id = table_id + self.config = config + + def _serialize_body(self): + msg_pack_into(ofproto.OFP_TABLE_MOD_PACK_STR, self.buf, + ofproto.OFP_HEADER_SIZE, + self.table_id, self.config) + + @_register_parser @_set_msg_type(ofproto.OFPT_MULTIPART_REPLY) class OFPMultipartReply(MsgBase): |