Allow pacf openflow plugin to speficy a priority offset.

This commit is contained in:
Johanna Amann 2015-05-14 08:15:43 -07:00
parent 208d150a0e
commit 8c292ddd49

View file

@ -9,6 +9,7 @@ export {
forward: bool &default=T; forward: bool &default=T;
idle_timeout: count &default=60; idle_timeout: count &default=60;
table_id: count &optional; table_id: count &optional;
priority_offset: int &default=+0; ##< add this to all rule priorities. Can be useful if you want the openflow priorities be offset from the pacf priorities without having to write a filter function.
check_pred: function(p: PluginState, r: Rule): bool &optional &weaken; check_pred: function(p: PluginState, r: Rule): bool &optional &weaken;
match_pred: function(p: PluginState, e: Entity, m: vector of OpenFlow::ofp_match): vector of OpenFlow::ofp_match &optional &weaken; match_pred: function(p: PluginState, e: Entity, m: vector of OpenFlow::ofp_match): vector of OpenFlow::ofp_match &optional &weaken;
@ -179,7 +180,7 @@ function openflow_rule_to_flow_mod(p: PluginState, r: Rule) : OpenFlow::ofp_flow
$cookie=r$id, $cookie=r$id,
$command=OpenFlow::OFPFC_ADD, $command=OpenFlow::OFPFC_ADD,
$idle_timeout=c$idle_timeout, $idle_timeout=c$idle_timeout,
$priority=int_to_count(r$priority) $priority=int_to_count(r$priority + c$priority_offset)
); );
if ( r?$expire ) if ( r?$expire )