summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/ofctl_v1_2.py16
-rw-r--r--ryu/lib/ofctl_v1_3.py16
2 files changed, 26 insertions, 6 deletions
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index 7308e1c1..385b5ae3 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -163,9 +163,19 @@ def actions_to_str(instructions):
for instruction in instructions:
if isinstance(instruction,
ofproto_v1_2_parser.OFPInstructionActions):
- for a in instruction.actions:
- actions.append(action_to_str(a))
-
+ if instruction.type == ofproto_v1_2.OFPIT_APPLY_ACTIONS:
+ for a in instruction.actions:
+ actions.append(action_to_str(a))
+ elif instruction.type == ofproto_v1_2.OFPIT_WRITE_ACTIONS:
+ write_actions = []
+ for a in instruction.actions:
+ write_actions.append(action_to_str(a))
+ if write_actions:
+ actions.append({'WRITE_ACTIONS': write_actions})
+ elif instruction.type == ofproto_v1_2.OFPIT_CLEAR_ACTIONS:
+ actions.append('CLEAR_ACTIONS')
+ else:
+ actions.append('UNKNOWN')
elif isinstance(instruction,
ofproto_v1_2_parser.OFPInstructionGotoTable):
buf = 'GOTO_TABLE:' + str(instruction.table_id)
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 15452e6e..037b04ad 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -175,9 +175,19 @@ def actions_to_str(instructions):
for instruction in instructions:
if isinstance(instruction,
ofproto_v1_3_parser.OFPInstructionActions):
- for a in instruction.actions:
- actions.append(action_to_str(a))
-
+ if instruction.type == ofproto_v1_3.OFPIT_APPLY_ACTIONS:
+ for a in instruction.actions:
+ actions.append(action_to_str(a))
+ elif instruction.type == ofproto_v1_3.OFPIT_WRITE_ACTIONS:
+ write_actions = []
+ for a in instruction.actions:
+ write_actions.append(action_to_str(a))
+ if write_actions:
+ actions.append({'WRITE_ACTIONS': write_actions})
+ elif instruction.type == ofproto_v1_3.OFPIT_CLEAR_ACTIONS:
+ actions.append('CLEAR_ACTIONS')
+ else:
+ actions.append('UNKNOWN')
elif isinstance(instruction,
ofproto_v1_3_parser.OFPInstructionGotoTable):
buf = 'GOTO_TABLE:' + str(instruction.table_id)