mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
openflow: Remove Broker::auto_publish()
This commit is contained in:
parent
cb10852f99
commit
b32153037a
1 changed files with 2 additions and 11 deletions
|
@ -13,15 +13,6 @@ export {
|
||||||
global cluster_flow_clear: event(name: string);
|
global cluster_flow_clear: event(name: string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@if ( Cluster::local_node_type() != Cluster::MANAGER )
|
|
||||||
# Workers need ability to forward commands to manager.
|
|
||||||
event zeek_init()
|
|
||||||
{
|
|
||||||
Broker::auto_publish(Cluster::manager_topic, OpenFlow::cluster_flow_mod);
|
|
||||||
Broker::auto_publish(Cluster::manager_topic, OpenFlow::cluster_flow_clear);
|
|
||||||
}
|
|
||||||
@endif
|
|
||||||
|
|
||||||
# the flow_mod function wrapper
|
# the flow_mod function wrapper
|
||||||
function flow_mod(controller: Controller, match: ofp_match, flow_mod: ofp_flow_mod): bool
|
function flow_mod(controller: Controller, match: ofp_match, flow_mod: ofp_flow_mod): bool
|
||||||
{
|
{
|
||||||
|
@ -31,7 +22,7 @@ function flow_mod(controller: Controller, match: ofp_match, flow_mod: ofp_flow_m
|
||||||
if ( Cluster::local_node_type() == Cluster::MANAGER )
|
if ( Cluster::local_node_type() == Cluster::MANAGER )
|
||||||
return controller$flow_mod(controller$state, match, flow_mod);
|
return controller$flow_mod(controller$state, match, flow_mod);
|
||||||
else
|
else
|
||||||
event OpenFlow::cluster_flow_mod(controller$state$_name, match, flow_mod);
|
Broker::publish(Cluster::manager_topic, OpenFlow::cluster_flow_mod, controller$state$_name, match, flow_mod);
|
||||||
|
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +35,7 @@ function flow_clear(controller: Controller): bool
|
||||||
if ( Cluster::local_node_type() == Cluster::MANAGER )
|
if ( Cluster::local_node_type() == Cluster::MANAGER )
|
||||||
return controller$flow_clear(controller$state);
|
return controller$flow_clear(controller$state);
|
||||||
else
|
else
|
||||||
event OpenFlow::cluster_flow_clear(controller$state$_name);
|
Broker::publish(Cluster::manager_topic, OpenFlow::cluster_flow_clear, controller$state$_name);
|
||||||
|
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue