diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-08-27 14:55:23 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-08-27 21:03:08 +0900 |
commit | 012513848d869865a7cb50dc6aa5f0d6972094f6 (patch) | |
tree | 175e5acbd932b4818a2413a785e11983b2ccee8e | |
parent | cec887faa4565f1424b6a39ff6c70c8a1724bd36 (diff) |
of12: set default args for FlowMod
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_2_parser.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py index 3ad700da..833f17bc 100644 --- a/ryu/ofproto/ofproto_v1_2_parser.py +++ b/ryu/ofproto/ofproto_v1_2_parser.py @@ -407,9 +407,13 @@ class OFPPacketOut(MsgBase): @_set_msg_type(ofproto_v1_2.OFPT_FLOW_MOD) class OFPFlowMod(MsgBase): - def __init__(self, datapath, cookie, cookie_mask, table_id, command, - idle_timeout, hard_timeout, priority, buffer_id, out_port, - out_group, flags, match, instructions): + def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, + command=ofproto_v1_2.OFPFC_ADD, + idle_timeout=0, hard_timeout=0, priority=0, + buffer_id=ofproto_v1_2.OFP_NO_BUFFER, + out_port=0, out_group=0, flags=0, + match=None, + instructions=[]): super(OFPFlowMod, self).__init__(datapath) self.cookie = cookie self.cookie_mask = cookie_mask @@ -422,6 +426,8 @@ class OFPFlowMod(MsgBase): self.out_port = out_port self.out_group = out_group self.flags = flags + if match is None: + match = OFPMatch() self.match = match self.instructions = instructions |