summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2013-12-16 14:14:45 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-12-17 19:51:07 +0900
commit52540f27da066316cfb74c928987db3cc236a60d (patch)
tree5e9ac806ba5cb66f7cbe95d74d0d82a5a95d2e6d
parent31b0f1625b02409a24a108eac1e20946fe9014d3 (diff)
lib: ofctl: support the specified max_len of flow_mod
this patch makes the max_len of flow_mod message more flexible. before applying this patch: ofctl_v1_0: 128 bytes for packet_in (fixed size) and none for others (fixed) ofctl_v1_2: 128 bytes for packet_in (fixed size) and 0 for others (fixed size) ofctl_v1_3: 0 for all by default (flexible) ofctl_v1_3 will send 0 byte length data in a packet_in message if max_len is not specified. after applying this patch: all version: MAX_LEN for all by default (flexible) NOTE: MAX_LEN is 65535 for OF1.0, and is OFPCML_MAX for OF1.2/1.3. max_len is omissible by every ofctl. Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/ofctl_v1_0.py9
-rw-r--r--ryu/lib/ofctl_v1_2.py5
-rw-r--r--ryu/lib/ofctl_v1_3.py2
3 files changed, 6 insertions, 10 deletions
diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
index 0fd958c0..ea317f7a 100644
--- a/ryu/lib/ofctl_v1_0.py
+++ b/ryu/lib/ofctl_v1_0.py
@@ -33,12 +33,9 @@ def to_actions(dp, acts):
action_type = a.get('type')
if action_type == 'OUTPUT':
out_port = int(a.get('port', ofproto_v1_0.OFPP_NONE))
- if out_port == dp.ofproto.OFPP_CONTROLLER:
- miss_send_len = ofproto_v1_0.OFP_DEFAULT_MISS_SEND_LEN
- actions.append(dp.ofproto_parser.OFPActionOutput(
- out_port, max_len=miss_send_len))
- else:
- actions.append(dp.ofproto_parser.OFPActionOutput(out_port))
+ max_len = int(a.get('max_len', 65535))
+ actions.append(dp.ofproto_parser.OFPActionOutput(
+ out_port, max_len=max_len))
elif action_type == 'SET_VLAN_VID':
vlan_vid = int(a.get('vlan_vid', 0xffff))
actions.append(dp.ofproto_parser.OFPActionVlanVid(vlan_vid))
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index 5237cf70..e768efa0 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -36,10 +36,9 @@ def to_actions(dp, acts):
action_type = a.get('type')
if action_type == 'OUTPUT':
out_port = int(a.get('port', ofproto_v1_2.OFPP_ANY))
- miss_send_len = (128 if out_port == dp.ofproto.OFPP_CONTROLLER
- else 0)
+ max_len = int(a.get('max_len', ofproto_v1_2.OFPCML_MAX))
actions = [dp.ofproto_parser.OFPActionOutput(
- out_port, max_len=miss_send_len)]
+ out_port, max_len=max_len)]
inst_type = dp.ofproto.OFPIT_APPLY_ACTIONS
inst = [dp.ofproto_parser.OFPInstructionActions(
inst_type, actions)]
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 4a61b9ce..752d518c 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -39,7 +39,7 @@ def to_actions(dp, acts):
action_type = a.get('type')
if action_type == 'OUTPUT':
out_port = int(a.get('port', ofproto_v1_3.OFPP_ANY))
- max_len = int(a.get('max_len', 0))
+ max_len = int(a.get('max_len', ofproto_v1_3.OFPCML_MAX))
actions.append((parser.OFPActionOutput(out_port,
max_len)))
elif action_type == 'COPY_TTL_OUT':