summaryrefslogtreecommitdiff
path: root/python/ovs/flow/ofp.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/ovs/flow/ofp.py')
-rw-r--r--python/ovs/flow/ofp.py50
1 files changed, 35 insertions, 15 deletions
diff --git a/python/ovs/flow/ofp.py b/python/ovs/flow/ofp.py
index 0bc110c57..3d79ed6ad 100644
--- a/python/ovs/flow/ofp.py
+++ b/python/ovs/flow/ofp.py
@@ -243,6 +243,7 @@ class OFPFlow(Flow):
**OFPFlow._fw_action_decoders_args(),
**OFPFlow._control_action_decoders_args(),
**OFPFlow._other_action_decoders_args(),
+ **OFPFlow._instruction_action_decoders_args(),
}
clone_actions = OFPFlow._clone_actions_decoders_args(actions)
actions.update(clone_actions)
@@ -272,6 +273,8 @@ class OFPFlow(Flow):
"pop_vlan": decode_flag,
"strip_vlan": decode_flag,
"push_vlan": decode_default,
+ "pop_mpls": decode_int,
+ "push_mpls": decode_int,
"decap": decode_flag,
"encap": decode_encap,
}
@@ -286,8 +289,8 @@ class OFPFlow(Flow):
"set_mpls_ttl",
"mod_nw_tos",
"mod_nw_ecn",
- "mod_tcp_src",
- "mod_tcp_dst",
+ "mod_tp_src",
+ "mod_tp_dst",
]
return {
"load": decode_load_field,
@@ -299,9 +302,15 @@ class OFPFlow(Flow):
"mod_dl_src": EthMask,
"mod_nw_dst": IPMask,
"mod_nw_src": IPMask,
+ "mod_nw_ttl": decode_int,
+ "mod_vlan_vid": decode_int,
+ "set_vlan_vid": decode_int,
+ "mod_vlan_pcp": decode_int,
+ "set_vlan_pcp": decode_int,
"dec_ttl": decode_dec_ttl,
"dec_mpls_ttl": decode_flag,
"dec_nsh_ttl": decode_flag,
+ "delete_field": decode_field,
"check_pkt_larger": decode_chk_pkt_larger,
**{field: decode_default for field in field_default_decoders},
}
@@ -342,6 +351,14 @@ class OFPFlow(Flow):
)
),
"ct_clear": decode_flag,
+ "fin_timeout": nested_kv_decoder(
+ KVDecoders(
+ {
+ "idle_timeout": decode_time,
+ "hard_timeout": decode_time,
+ }
+ )
+ ),
}
@staticmethod
@@ -382,22 +399,13 @@ class OFPFlow(Flow):
actions.
"""
return {
- "learn": decode_learn(
- {
- **action_decoders,
- "fin_timeout": nested_kv_decoder(
- KVDecoders(
- {
- "idle_timeout": decode_time,
- "hard_timeout": decode_time,
- }
- )
- ),
- }
- ),
+ "learn": decode_learn(action_decoders),
"clone": functools.partial(
decode_exec, KVDecoders(action_decoders)
),
+ "write_actions": functools.partial(
+ decode_exec, KVDecoders(action_decoders)
+ ),
}
@staticmethod
@@ -426,3 +434,15 @@ class OFPFlow(Flow):
)
),
}
+
+ @staticmethod
+ def _instruction_action_decoders_args():
+ """Generate the decoder arguments for instruction actions
+ (see man(7) ovs-actions)."""
+ return {
+ "meter": decode_int,
+ "clear_actions": decode_flag,
+ # write_actions moved to _clone actions
+ "write_metadata": decode_mask(64),
+ "goto_table": decode_int,
+ }