diff options
author | Simon Horman <horms@verge.net.au> | 2014-02-20 09:11:06 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-02-26 23:39:41 +0900 |
commit | 5a4adf497e5cc18258de5cf51e6d9320c6577e32 (patch) | |
tree | 60729a9a46d6f3615fa405b7815ce57c79719e91 | |
parent | 727307cabb9f5dfc8a4dc614b54a42a35559b1b0 (diff) |
of14: Add properties support to flow mod
With this change the initialiser of OFPTableMod now
requires a properties argument. This is incompatible with
Ryu v3.6. If it is important to maintain compatibility
then things can be reworked a little to make the properties
argument optional.
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 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 1e336376..e1961bf6 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -1822,18 +1822,28 @@ class OFPTableMod(MsgBase): ofp_parser = datapath.ofproto_parser req = ofp_parser.OFPTableMod(datapath, 1, 3) + flags = ofproto.OFPTMPEF_OTHER + properties = [ofp_parser.OFPTableModPropEviction(flags)] + req = ofp_parser.OFPTableMod(datapath, 1, 3, properties) datapath.send_msg(req) """ - def __init__(self, datapath, table_id, config): + def __init__(self, datapath, table_id, config, properties): super(OFPTableMod, self).__init__(datapath) self.table_id = table_id self.config = config + self.properties = properties def _serialize_body(self): + props_buf = bytearray() + for p in self.properties: + props_buf += p.serialize() + msg_pack_into(ofproto.OFP_TABLE_MOD_PACK_STR, self.buf, ofproto.OFP_HEADER_SIZE, self.table_id, self.config) + self.buf += props_buf + @_register_parser @_set_msg_type(ofproto.OFPT_MULTIPART_REPLY) |