diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-07-18 12:39:33 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-07-18 16:54:43 +0900 |
commit | e3e703970d47b0b433a7b1b55146227ca2371533 (patch) | |
tree | 0b7e5110a8c8100c6506693cd672d2c92b57e835 | |
parent | 112c7e5496828095d300cb4421ce89d69216bc84 (diff) |
cbench: specify OF1.0
cbench works with only OF1.0 and OF1.0 provides all cbench needs. So
specify OF1.0.
Also it doesn't need nxm so use OFPMatch and OFPFlowMod.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
-rw-r--r-- | ryu/app/cbench.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ryu/app/cbench.py b/ryu/app/cbench.py index c82ae538..c84c62e7 100644 --- a/ryu/app/cbench.py +++ b/ryu/app/cbench.py @@ -19,10 +19,12 @@ from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls -from ryu.ofproto import nx_match +from ryu.ofproto import ofproto_v1_0 class Cbench(app_manager.RyuApp): + OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] + def __init__(self, *args, **kwargs): super(Cbench, self).__init__(*args, **kwargs) @@ -32,8 +34,13 @@ class Cbench(app_manager.RyuApp): datapath = msg.datapath ofproto = datapath.ofproto - rule = nx_match.ClsRule() - datapath.send_flow_mod( - rule=rule, cookie=0, command=ofproto.OFPFC_ADD, + match = datapath.ofproto_parser.OFPMatch( + ofproto_v1_0.OFPFW_ALL, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0) + + mod = datapath.ofproto_parser.OFPFlowMod( + datapath, match=match, cookie=0, command=ofproto.OFPFC_ADD, idle_timeout=0, hard_timeout=0, - priority=ofproto.OFP_DEFAULT_PRIORITY, flags=0, actions=None) + priority=ofproto.OFP_DEFAULT_PRIORITY, + flags=0, actions=None) + datapath.send_msg(mod) |