mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
GH-387: update Broker topic names to use "zeek/" prefix
This commit is contained in:
parent
c25520cf3f
commit
1ce0fcce49
35 changed files with 351 additions and 309 deletions
|
@ -22,7 +22,7 @@ redef Cluster::nodes = {
|
|||
|
||||
global my_pool_spec: Cluster::PoolSpec =
|
||||
Cluster::PoolSpec(
|
||||
$topic = "bro/cluster/pool/my_pool",
|
||||
$topic = "zeek/cluster/pool/my_pool",
|
||||
$node_type = Cluster::PROXY
|
||||
);
|
||||
|
||||
|
@ -30,7 +30,7 @@ global my_pool: Cluster::Pool;
|
|||
|
||||
redef Cluster::proxy_pool_spec =
|
||||
Cluster::PoolSpec(
|
||||
$topic = "bro/cluster/pool/proxy",
|
||||
$topic = "zeek/cluster/pool/proxy",
|
||||
$node_type = Cluster::PROXY,
|
||||
$exclusive = T,
|
||||
$max_nodes = 1
|
||||
|
|
|
@ -22,7 +22,7 @@ redef Cluster::nodes = {
|
|||
|
||||
global my_pool_spec: Cluster::PoolSpec =
|
||||
Cluster::PoolSpec(
|
||||
$topic = "bro/cluster/pool/my_pool",
|
||||
$topic = "zeek/cluster/pool/my_pool",
|
||||
$node_type = Cluster::PROXY
|
||||
);
|
||||
|
||||
|
@ -30,7 +30,7 @@ global my_pool: Cluster::Pool;
|
|||
|
||||
redef Cluster::proxy_pool_spec =
|
||||
Cluster::PoolSpec(
|
||||
$topic = "bro/cluster/pool/proxy",
|
||||
$topic = "zeek/cluster/pool/proxy",
|
||||
$node_type = Cluster::PROXY,
|
||||
$exclusive = F,
|
||||
$max_nodes = 1
|
||||
|
|
|
@ -21,7 +21,7 @@ event zeek_init()
|
|||
|
||||
event NetControl::init()
|
||||
{
|
||||
local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="bro/event/netcontroltest"));
|
||||
local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="zeek/event/netcontroltest"));
|
||||
NetControl::activate(netcontrol_acld, 0);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ event die()
|
|||
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("bro/event/netcontroltest");
|
||||
Broker::subscribe("zeek/event/netcontroltest");
|
||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
}
|
||||
|
||||
|
@ -116,14 +116,14 @@ event NetControl::acld_add_rule(id: count, r: NetControl::Rule, ar: NetControl::
|
|||
{
|
||||
print "add_rule", id, r$entity, r$ty, ar;
|
||||
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_added, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_added, id, r, ar$command);
|
||||
}
|
||||
|
||||
event NetControl::acld_remove_rule(id: count, r: NetControl::Rule, ar: NetControl::AclRule)
|
||||
{
|
||||
print "remove_rule", id, r$entity, r$ty, ar;
|
||||
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_removed, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_removed, id, r, ar$command);
|
||||
|
||||
if ( r$cid == 4 )
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ event zeek_init()
|
|||
|
||||
event NetControl::init()
|
||||
{
|
||||
local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="bro/event/netcontroltest"));
|
||||
local netcontrol_acld = NetControl::create_acld(NetControl::AcldConfig($acld_host=127.0.0.1, $acld_port=to_port(getenv("BROKER_PORT")), $acld_topic="zeek/event/netcontroltest"));
|
||||
NetControl::activate(netcontrol_acld, 0);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ event die()
|
|||
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("bro/event/netcontroltest");
|
||||
Broker::subscribe("zeek/event/netcontroltest");
|
||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
}
|
||||
|
||||
|
@ -122,9 +122,9 @@ event NetControl::acld_add_rule(id: count, r: NetControl::Rule, ar: NetControl::
|
|||
print "add_rule", id, r$entity, r$ty, ar;
|
||||
|
||||
if ( r$cid != 3 )
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_added, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_added, id, r, ar$command);
|
||||
else
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_exists, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_exists, id, r, ar$command);
|
||||
}
|
||||
|
||||
event NetControl::acld_remove_rule(id: count, r: NetControl::Rule, ar: NetControl::AclRule)
|
||||
|
@ -132,9 +132,9 @@ event NetControl::acld_remove_rule(id: count, r: NetControl::Rule, ar: NetContro
|
|||
print "remove_rule", id, r$entity, r$ty, ar;
|
||||
|
||||
if ( r$cid != 2 )
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_removed, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_removed, id, r, ar$command);
|
||||
else
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::acld_rule_error, id, r, ar$command);
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::acld_rule_error, id, r, ar$command);
|
||||
|
||||
if ( r$cid == 4 )
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ event zeek_init()
|
|||
|
||||
event NetControl::init()
|
||||
{
|
||||
local netcontrol_broker = NetControl::create_broker(NetControl::BrokerConfig($host=127.0.0.1, $bport=to_port(getenv("BROKER_PORT")), $topic="bro/event/netcontroltest"), T);
|
||||
local netcontrol_broker = NetControl::create_broker(NetControl::BrokerConfig($host=127.0.0.1, $bport=to_port(getenv("BROKER_PORT")), $topic="zeek/event/netcontroltest"), T);
|
||||
NetControl::activate(netcontrol_broker, 0);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ event die()
|
|||
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("bro/event/netcontroltest");
|
||||
Broker::subscribe("zeek/event/netcontroltest");
|
||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
}
|
||||
|
||||
|
@ -106,19 +106,19 @@ event NetControl::broker_add_rule(id: count, r: NetControl::Rule)
|
|||
print "add_rule", id, r$entity, r$ty;
|
||||
|
||||
if ( r$cid == 3 )
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::broker_rule_added, id, r, "");
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::broker_rule_added, id, r, "");
|
||||
if ( r$cid == 2 )
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::broker_rule_exists, id, r, "");
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::broker_rule_exists, id, r, "");
|
||||
|
||||
if ( r$cid == 2 )
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::broker_rule_timeout, id, r, NetControl::FlowInfo());
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::broker_rule_timeout, id, r, NetControl::FlowInfo());
|
||||
}
|
||||
|
||||
event NetControl::broker_remove_rule(id: count, r: NetControl::Rule, reason: string)
|
||||
{
|
||||
print "remove_rule", id, r$entity, r$ty, reason;
|
||||
|
||||
Broker::publish("bro/event/netcontroltest", NetControl::broker_rule_removed, id, r, "");
|
||||
Broker::publish("zeek/event/netcontroltest", NetControl::broker_rule_removed, id, r, "");
|
||||
|
||||
if ( r$cid == 3 )
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ global of_controller: OpenFlow::Controller;
|
|||
event zeek_init()
|
||||
{
|
||||
suspend_processing();
|
||||
of_controller = OpenFlow::broker_new("broker1", 127.0.0.1, to_port(getenv("BROKER_PORT")), "bro/openflow", 42);
|
||||
of_controller = OpenFlow::broker_new("broker1", 127.0.0.1, to_port(getenv("BROKER_PORT")), "zeek/openflow", 42);
|
||||
}
|
||||
|
||||
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||
|
@ -88,7 +88,7 @@ redef exit_only_after_terminate = T;
|
|||
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("bro/openflow");
|
||||
Broker::subscribe("zeek/openflow");
|
||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
}
|
||||
|
||||
|
@ -105,8 +105,8 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
event OpenFlow::broker_flow_mod(name: string, dpid: count, match: OpenFlow::ofp_match, flow_mod: OpenFlow::ofp_flow_mod)
|
||||
{
|
||||
print "got flow_mod", dpid, match, flow_mod;
|
||||
Broker::publish("bro/openflow", OpenFlow::flow_mod_success, name, match, flow_mod, "");
|
||||
Broker::publish("bro/openflow", OpenFlow::flow_mod_failure, name, match, flow_mod, "");
|
||||
Broker::publish("zeek/openflow", OpenFlow::flow_mod_success, name, match, flow_mod, "");
|
||||
Broker::publish("zeek/openflow", OpenFlow::flow_mod_failure, name, match, flow_mod, "");
|
||||
}
|
||||
|
||||
event OpenFlow::broker_flow_clear(name: string, dpid: count)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue