summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-04-04 18:37:55 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-05-01 08:45:54 +0900
commitc721e811c860406a174a2de5ce7bc7ca5c456e15 (patch)
treefdddd3c3f45885d57c6b9ab075d3fa1caf772ef7
parent5eaf2ad32d95ae145f9a4f77b96d6e9b9b284f96 (diff)
ofproto/ofproto_v1_0_parser: flowmod default parameter
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_0_parser.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py
index 88900ac5..693d873f 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -744,9 +744,18 @@ class NXTSetFlowFormat(NXTRequest):
class NXTFlowMod(NXTRequest):
- def __init__(self, datapath, cookie, command, idle_timeout,
- hard_timeout, priority, buffer_id, out_port,
- flags, rule, actions=None):
+ def __init__(self, datapath, cookie, command,
+ idle_timeout=0, hard_timeout=0,
+ priority=ofproto_v1_0.OFP_DEFAULT_PRIORITY,
+ buffer_id=0xffffffff, out_port=ofproto_v1_0.OFPP_NONE,
+ flags=0, rule=None, actions=None):
+
+ # the argument, rule, is positioned at the one before the last due
+ # to the layout struct nxt_flow_mod.
+ # Although rule must be given, default argument to rule, None,
+ # is given to allow other default value of argument before rule.
+ assert rule is not None
+
if actions is None:
actions = []
super(NXTFlowMod, self).__init__(datapath, ofproto_v1_0.NXT_FLOW_MOD)
@@ -1156,8 +1165,8 @@ class OFPPacketOut(MsgBase):
@_set_msg_type(ofproto_v1_0.OFPT_FLOW_MOD)
class OFPFlowMod(MsgBase):
- def __init__(self, datapath, match, cookie=0,
- command=0, idle_timeout=0, hard_timeout=0,
+ def __init__(self, datapath, match, cookie, command,
+ idle_timeout=0, hard_timeout=0,
priority=ofproto_v1_0.OFP_DEFAULT_PRIORITY,
buffer_id=0xffffffff, out_port=ofproto_v1_0.OFPP_NONE,
flags=0, actions=None):