diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2012-04-04 18:37:54 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-05-01 08:44:52 +0900 |
commit | 5eaf2ad32d95ae145f9a4f77b96d6e9b9b284f96 (patch) | |
tree | b3e3ae98770e027bce31c90524d8b6b96e1e2122 | |
parent | 57bd1abe5c6abdf6e6dff2c85fd75079ae7a3909 (diff) |
ofproto/ofproto_v1_0_parser: make FlowMod allow meaningful default parameter
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Simon Horman <simon@horms.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_0_parser.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py index c0a323b7..88900ac5 100644 --- a/ryu/ofproto/ofproto_v1_0_parser.py +++ b/ryu/ofproto/ofproto_v1_0_parser.py @@ -746,7 +746,9 @@ class NXTSetFlowFormat(NXTRequest): class NXTFlowMod(NXTRequest): def __init__(self, datapath, cookie, command, idle_timeout, hard_timeout, priority, buffer_id, out_port, - flags, rule, actions): + flags, rule, actions=None): + if actions is None: + actions = [] super(NXTFlowMod, self).__init__(datapath, ofproto_v1_0.NXT_FLOW_MOD) self.cookie = cookie self.command = command @@ -1154,10 +1156,13 @@ class OFPPacketOut(MsgBase): @_set_msg_type(ofproto_v1_0.OFPT_FLOW_MOD) class OFPFlowMod(MsgBase): - def __init__(self, datapath, match=None, cookie=None, - command=None, idle_timeout=None, hard_timeout=None, - priority=None, buffer_id=None, out_port=None, - flags=None, actions=None): + def __init__(self, datapath, match, cookie=0, + command=0, 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): + if actions is None: + actions = [] super(OFPFlowMod, self).__init__(datapath) self.match = match self.cookie = cookie |