mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Local variables. Baselines and data_type_local.bro btest-able script.
This commit is contained in:
parent
cce5565d63
commit
b8c31458ff
10 changed files with 150 additions and 11 deletions
|
@ -2,8 +2,8 @@
|
|||
|
||||
}, addl=, hot=0, history=ShADadFf, uid=UWkUyAuUGXf, tunnel=<uninitialized>, conn=[ts=930613226.067666, uid=UWkUyAuUGXf, id=[orig_h=212.180.42.100, orig_p=25000/tcp, resp_h=131.243.64.3, resp_p=53/tcp], proto=tcp, service=<uninitialized>, duration=0.709643, orig_bytes=29, resp_bytes=44, conn_state=SF, local_orig=<uninitialized>, missed_bytes=0, history=ShADadFf, orig_pkts=6, orig_ip_bytes=273, resp_pkts=5, resp_ip_bytes=248, tunnel_parents={
|
||||
|
||||
}], extract_orig=F, extract_resp=F, dns=[ts=930613226.518174, uid=UWkUyAuUGXf, id=[orig_h=212.180.42.100, orig_p=25000/tcp, resp_h=131.243.64.3, resp_p=53/tcp], proto=tcp, trans_id=34798, query=<uninitialized>, qclass=<uninitialized>, qclass_name=<uninitialized>, qtype=<uninitialized>, qtype_name=<uninitialized>, rcode=0, rcode_name=NOERROR, AA=F, TC=F, RD=F, RA=T, Z=0, answers=[4.3.2.1], TTLs=[8.0 hrs 42.0 mins 17.0 secs], rejected=F, ready=F, total_answers=0, total_replies=1], dns_state=[pending={
|
||||
[34798] = [ts=930613226.518174, uid=UWkUyAuUGXf, id=[orig_h=212.180.42.100, orig_p=25000/tcp, resp_h=131.243.64.3, resp_p=53/tcp], proto=tcp, trans_id=34798, query=<uninitialized>, qclass=<uninitialized>, qclass_name=<uninitialized>, qtype=<uninitialized>, qtype_name=<uninitialized>, rcode=0, rcode_name=NOERROR, AA=F, TC=F, RD=F, RA=T, Z=0, answers=[4.3.2.1], TTLs=[8.0 hrs 42.0 mins 17.0 secs], rejected=F, ready=F, total_answers=0, total_replies=1]
|
||||
}, finished_answers={
|
||||
}], extract_orig=F, extract_resp=F, dns=<uninitialized>, dns_state=[pending={
|
||||
|
||||
}, finished_answers={
|
||||
34798
|
||||
}]]
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[1, 2, 3, 4]
|
||||
[1, 2, 3, 4]
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
[6666/tcp] = IRC,
|
||||
[80/tcp] = WWW
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
A: 10, B: 10
|
|
@ -0,0 +1 @@
|
|||
i + 2 = 12
|
10
testing/btest/doc/manual/data_struct_vector.bro
Normal file
10
testing/btest/doc/manual/data_struct_vector.bro
Normal file
|
@ -0,0 +1,10 @@
|
|||
# @TEST-EXEC: bro %INPUT
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local v: vector of count = vector(1, 2, 3, 4);
|
||||
local w = vector(1, 2, 3, 4);
|
||||
print v;
|
||||
print w;
|
||||
}
|
12
testing/btest/doc/manual/data_type_const.bro
Normal file
12
testing/btest/doc/manual/data_type_const.bro
Normal file
|
@ -0,0 +1,12 @@
|
|||
# @TEST-EXEC: bro -b %INPUT
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
const port_list: table[port] of string &redef;
|
||||
|
||||
redef port_list += { [6666/tcp] = "IRC"};
|
||||
redef port_list += { [80/tcp] = "WWW" };
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
print port_list;
|
||||
}
|
14
testing/btest/doc/manual/data_type_declaration.bro
Normal file
14
testing/btest/doc/manual/data_type_declaration.bro
Normal file
|
@ -0,0 +1,14 @@
|
|||
# @TEST-EXEC: bro %INPUT
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local a: int;
|
||||
a = 10;
|
||||
local b = 10;
|
||||
|
||||
if (a == b)
|
||||
{
|
||||
print fmt("A: %d, B: %d", a, b);
|
||||
}
|
||||
}
|
14
testing/btest/doc/manual/data_type_local.bro
Normal file
14
testing/btest/doc/manual/data_type_local.bro
Normal file
|
@ -0,0 +1,14 @@
|
|||
# @TEST-EXEC: bro %INPUT
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
|
||||
function add_two(i: count): count
|
||||
{
|
||||
local added_two = i+2;
|
||||
print fmt("i + 2 = %d", added_two);
|
||||
return added_two;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local test = add_two(10);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue