summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-04-04 18:37:56 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-05-01 08:47:50 +0900
commit7d19e5c7dfe43b1d1a858697c3832166f4575b8f (patch)
treeca40cc5ec0da9ed9d4be10ff6834a49652f79b25
parentc721e811c860406a174a2de5ce7bc7ca5c456e15 (diff)
app: use symbol instead of 32678 for default priority
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/cbench.py4
-rw-r--r--ryu/app/simple_isolation.py11
-rw-r--r--ryu/app/simple_switch.py3
3 files changed, 11 insertions, 7 deletions
diff --git a/ryu/app/cbench.py b/ryu/app/cbench.py
index 4d89f867..81ed539c 100644
--- a/ryu/app/cbench.py
+++ b/ryu/app/cbench.py
@@ -34,5 +34,5 @@ class Cbench(object):
rule = nx_match.ClsRule()
datapath.send_flow_mod(
rule=rule, cookie=0, command=ofproto.OFPFC_ADD,
- idle_timeout=0, hard_timeout=0, priority=32768,
- flags=0, actions=None)
+ idle_timeout=0, hard_timeout=0,
+ priority=ofproto.OFP_DEFAULT_PRIORITY, flags=0, actions=None)
diff --git a/ryu/app/simple_isolation.py b/ryu/app/simple_isolation.py
index e6f3f855..1daf6be8 100644
--- a/ryu/app/simple_isolation.py
+++ b/ryu/app/simple_isolation.py
@@ -54,6 +54,7 @@ class SimpleIsolation(object):
@staticmethod
def _modflow_and_send_packet(msg, src, dst, actions):
datapath = msg.datapath
+ ofproto = datapath.ofproto
#
# install flow and then send packet
@@ -64,9 +65,10 @@ class SimpleIsolation(object):
rule.set_dl_src(src)
datapath.send_flow_mod(
rule=rule, cookie=0, command=datapath.ofproto.OFPFC_ADD,
- idle_timeout=0, hard_timeout=0, priority=32768,
- buffer_id=0xffffffff, out_port=datapath.ofproto.OFPP_NONE,
- flags=datapath.ofproto.OFPFF_SEND_FLOW_REM, actions=actions)
+ idle_timeout=0, hard_timeout=0,
+ priority=ofproto.OFP_DEFAULT_PRIORITY,
+ buffer_id=0xffffffff, out_port=ofproto.OFPP_NONE,
+ flags=ofproto.OFPFF_SEND_FLOW_REM, actions=actions)
datapath.send_packet_out(msg.buffer_id, msg.in_port, actions)
@@ -156,7 +158,8 @@ class SimpleIsolation(object):
rule.set_dl_dst(src)
datapath.send_flow_mod(rule=rule, cookie=0,
command=datapath.ofproto.OFPFC_DELETE, idle_timeout=0,
- hard_timeout=0, priority=32768, out_port=old_port)
+ hard_timeout=0, priority=datapath.ofproto.OFP_DEFAULT_PRIORITY,
+ out_port=old_port)
# to make sure the old flow entries are purged.
datapath.send_barrier()
diff --git a/ryu/app/simple_switch.py b/ryu/app/simple_switch.py
index 95d09424..c95b96ca 100644
--- a/ryu/app/simple_switch.py
+++ b/ryu/app/simple_switch.py
@@ -69,7 +69,8 @@ class SimpleSwitch(object):
rule.set_nw_dscp(0)
datapath.send_flow_mod(
rule=rule, cookie=0, command=ofproto.OFPFC_ADD,
- idle_timeout=0, hard_timeout=0, priority=32768,
+ idle_timeout=0, hard_timeout=0,
+ priority=ofproto.OFP_DEFAULT_PRIORITY,
flags=ofproto.OFPFF_SEND_FLOW_REM, actions=actions)
datapath.send_packet_out(msg.buffer_id, msg.in_port, actions)