mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
update uses of "when" in base scripts to include captures
This commit is contained in:
parent
f895008c34
commit
98cd3f2213
15 changed files with 21 additions and 21 deletions
|
@ -212,7 +212,7 @@ function pretty_print_alarm(out: file, n: Info)
|
|||
return;
|
||||
}
|
||||
|
||||
when ( local h1name = lookup_addr(h1) )
|
||||
when [out, n, h1, h2, line1, line2, line3] ( local h1name = lookup_addr(h1) )
|
||||
{
|
||||
if ( h2 == 0.0.0.0 )
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ function pretty_print_alarm(out: file, n: Info)
|
|||
return;
|
||||
}
|
||||
|
||||
when ( local h2name = lookup_addr(h2) )
|
||||
when [out, n, h1, h2, line1, line2, line3, h1name] ( local h2name = lookup_addr(h2) )
|
||||
{
|
||||
do_msg(out, n, line1, line2, line3, h1, h1name, h2, h2name);
|
||||
return;
|
||||
|
@ -240,7 +240,7 @@ function pretty_print_alarm(out: file, n: Info)
|
|||
return;
|
||||
}
|
||||
|
||||
when ( local h2name_ = lookup_addr(h2) )
|
||||
when [out, n, h1, h2, line1, line2, line3] ( local h2name_ = lookup_addr(h2) )
|
||||
{
|
||||
do_msg(out, n, line1, line2, line3, h1, "(dns timeout)", h2, h2name_);
|
||||
return;
|
||||
|
|
|
@ -135,9 +135,9 @@ function ryu_flow_mod(state: OpenFlow::ControllerState, match: ofp_match, flow_m
|
|||
);
|
||||
|
||||
# Execute call to Ryu's ReST API
|
||||
when ( local result = ActiveHTTP::request(request) )
|
||||
when [state, match, flow_mod, request] ( local result = ActiveHTTP::request(request) )
|
||||
{
|
||||
if(result$code == 200)
|
||||
if (result$code == 200)
|
||||
event OpenFlow::flow_mod_success(state$_name, match, flow_mod, result$body);
|
||||
else
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ function ryu_flow_clear(state: OpenFlow::ControllerState): bool
|
|||
$method="DELETE"
|
||||
);
|
||||
|
||||
when ( local result = ActiveHTTP::request(request) )
|
||||
when [request] ( local result = ActiveHTTP::request(request) )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ function data_added(ss: SumStat, key: Key, result: Result)
|
|||
function request(ss_name: string): ResultTable
|
||||
{
|
||||
# This only needs to be implemented this way for cluster compatibility.
|
||||
return when ( T )
|
||||
return when [ss_name] ( T )
|
||||
{
|
||||
if ( ss_name in result_store )
|
||||
return result_store[ss_name];
|
||||
|
@ -86,7 +86,7 @@ function request(ss_name: string): ResultTable
|
|||
function request_key(ss_name: string, key: Key): Result
|
||||
{
|
||||
# This only needs to be implemented this way for cluster compatibility.
|
||||
return when ( T )
|
||||
return when [ss_name, key] ( T )
|
||||
{
|
||||
if ( ss_name in result_store && key in result_store[ss_name] )
|
||||
return result_store[ss_name][key];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue