0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 20:05:21 +00:00
Commit Graph

598 Commits

Author SHA1 Message Date
Maria Matejka
7bbd0b5a3b Merge commit '37b64441' into thread-next 2022-11-07 10:28:01 +01:00
Maria Matejka
96d3804057 Merge commit '8478de88' into thread-next 2022-11-07 10:18:19 +01:00
Maria Matejka
37b6444137 Moved config-related allocations to config_pool and showing its size in memory usage 2022-11-01 16:38:24 +01:00
Ondrej Zajicek
e471f9e0fb Filter: Fix handling of variables in anonymous filters
Define scope for anonymous filters, and also explicitly distinguish block
scopes and function/filter scopes instead of using anonymous / named
distinction.

Anonymous filters forgot to push scope, so variables for them were in
fact defined in the top scope and therefore they shared a frame. This got
broken after rework of variables, which assumed that there is a named
scope for every function/filter.
2022-10-18 03:58:19 +02:00
Ondrej Zajicek
92a8565547 Filter: Add some minor functions for f_tree and EC
Add some supportive functions for f_tree and EC. These functions are used
by L3VPN code.
2022-10-03 20:18:12 +02:00
Maria Matejka
f51837ace6 Caching eattrs in filters is not needed anymore.
After flattening the route attribute structure, the ea_list ** is derivable
from rte * by arithmetics. Caching the derived value doesn't help performance
and therefore is removed as unnecessary.
2022-09-21 17:48:31 +02:00
Maria Matejka
05c63ae734 Flushing tmp_linpool in tree test and in static protocol 2022-09-21 17:48:31 +02:00
Maria Matejka
30a909f9bc Trie test uses direct tmp_allocz() instead of lp_allocz(tmp_linpool) 2022-09-21 12:08:52 +02:00
Maria Matejka
c179d4d644 Switched off forking for filter test.
You don't want to fork with threads running.
2022-09-19 12:58:19 +02:00
Maria Matejka
c73343de67 Revert "Reducing filter stack size to allow for lesser thread stack size"
This reverts commit 2c13759136.
2022-09-16 10:11:51 +02:00
Maria Matejka
fb7fb67445 Table access is now locked. 2022-09-08 15:24:02 +02:00
Maria Matejka
71b434a987 Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-next 2022-08-02 22:08:59 +02:00
Maria Matejka
08c8484608 Merge commit '94eb0858' into thread-next 2022-07-18 12:33:00 +02:00
Maria Matejka
68a2c9d4c9 Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-next 2022-07-13 14:14:37 +02:00
Maria Matejka
2e5bfeb73a Merge remote-tracking branch 'origin/master' into backport 2022-07-11 11:08:10 +02:00
Ondrej Zajicek (work)
cb339a3067 Filter: Implement for loops
For loops allow to iterate over elements in compound data like BGP paths
or community lists. The syntax is:

  for [ <type> ] <variable> in <expr> do <command-body>
2022-06-27 21:13:32 +02:00
Ondrej Zajicek (work)
1ac8e11bba Filter: Implement mixed declarations of local variables
Allow variable declarations mixed with code, also in nested blocks with
proper scoping, and with variable initializers. E.g:

function fn(int a)
{
  int b;
  int c = 10;

  if a > 20 then
  {
    b = 30;
    int d = c * 2;
    print a, b, c, d;
  }

  string s = "Hello";
}
2022-06-27 21:13:32 +02:00
Ondrej Zajicek (work)
a2527ee53d Filter: Improve handling of stack frames in filter bytecode
When f_line is done, we have to pop the stack frame. The old code just
removed nominal number of args/vars. Change it to use stored ventry value
modified by number of returned values. This allows to allocate variables
on a stack frame during execution of f_lines instead of just at start.

But we need to know the number of returned values for a f_line. It is 1
for term, 0 for cmd. Store that to f_line during linearization.
2022-06-27 21:13:32 +02:00
Ondrej Zajicek (work)
f31f4e6eef Filter: Simplify handling of command sequences
Command sequences in curly braces used a separate nonterminal in grammar.
Handle them as a regular command.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
1e6acf34bb Filter: Fix bug in variable shadowing
When a new variable used the same name as an existing symbol in an outer
scope, then offset number was defined based on a scope of the existing
symbol ($3) instead of a scope of the new symbol (sym_). That can lead
to two variables sharing the same memory slot.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
26bc4f9904 Filter: Implement direct recursion
Direct recursion almost worked, just crashed on function signature check.
Split function parsing such that function signature is saved before
function body is processed. Recursive calls are marked so they can be
avoided during f_same() and similar code walking.

Also, include tower of hanoi solver as a test case.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
fb1d8f6513 Filter: Apply constant promotion for FI_EQ / FI_NEQ
Equality comparison is defined on all values, even of different
types, but we still want to do constant promotion if possible.
2022-06-27 21:13:31 +02:00
Alexander Zubkov
b2d6d2948a Filter: Add literal for empty set
Add literal for empty set [], which works both for tree-based sets
and prefix sets by using existing constant promotion mechanism.

Minor changes by committer.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
8f3c6151b4 Nest: Cleanups in as_path_filter()
Use struct f_val as a common argument for as_path_filter(), as suggested
by Alexander Zubkov. That allows to use NULL sets as valid arguments.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
9b302c133f Filter: Ensure that all expressions declared return type
All instructions with a return value (i.e. expressions, ones with
non-zero outval, third argument in INST()) should declare their return
type. Check that automatically by M4 macros.

Set outval of FI_RETURN to 0. The instruction adds one value to stack,
but syntactically it is a statement, not an expression.

Add fake return type declaration to FI_CALL, otherwise the automatic
check would fail builds.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
cde8094c1f Filter: Improve description of type system 2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
93d6096c87 Filter: Implement type checks for function calls
Keep list of function parameters in f_line and use it to verify
types of arguments for function calls. Only static type checks
are implemented.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
4c0c507b1f Filter: Clean up function call instruction
Pass instructions of function call arguments as vararg arguments to
FI_CALL instruction constructor and move necessary magic from parser
code to interpreter / instruction code.
2022-06-27 21:13:31 +02:00
Maria Matejka
d2142ad405 Fixed displaying BGP and RIP attributes after recent reworks 2022-06-27 12:32:47 +02:00
Maria Matejka
0f2f5ac58c Fixed minor bugs in handling some route attributes 2022-06-27 12:32:47 +02:00
Maria Matejka
5c1ebe012e Fixed forgotten preference handling in filters 2022-06-26 14:31:31 +02:00
Maria Matejka
4364ee9b6f Merge commit '938742decc6e1d6d3a0375dd012b75172e747bbc' into haugesund 2022-06-08 15:31:28 +02:00
Maria Matejka
cae5979871 Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesund
There were quite a lot of conflicts in flowspec validation code which
ultimately led to some code being a bit rewritten, not only adapted from
this or that branch, yet it is still in a limit of a merge.
2022-06-08 11:47:49 +02:00
Maria Matejka
1493695c6b Merge commit 'f15f2fcee7eeb5a100bd204a0e67018e25953420' into haugesund 2022-05-30 17:37:08 +02:00
Maria Matejka
41508ceac3 Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesund 2022-05-30 17:26:25 +02:00
Maria Matejka
65254128e1 Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesund 2022-05-30 17:18:46 +02:00
Maria Matejka
1a92ee9d4d Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesund 2022-05-30 17:18:03 +02:00
Maria Matejka
5051e3c4af Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesund 2022-05-30 16:59:24 +02:00
Maria Matejka
8b4b7c6eae Merge commit 'cf07d8ad79273a3bbf0617c17e438602e4b64ece' into haugesund 2022-05-30 16:52:38 +02:00
Maria Matejka
d7bec897ab Merge commit 'ef4313e1667a8745c8d8813ac78342ec7c035895' into haugesund 2022-05-30 16:47:30 +02:00
Maria Matejka
e16e1e4138 Merge commit 'f2f3163f6c3fba7f9ef03640d7b2f6323873d2cc' into haugesund 2022-05-30 16:41:15 +02:00
Maria Matejka
0097f24e2e Merge commit 'de86040b2cf4ec9bfbb64f0e208a19d4d7e51adc' into haugesund 2022-05-30 16:21:48 +02:00
Maria Matejka
86ac1045d7 Merge commit '3fb70b26faca6788aa0bdf1d558414f9f777c6cd' into haugesund 2022-05-30 16:21:02 +02:00
Maria Matejka
b3649ec77e Merge commit 'ef6a903e6f44b467f9606018446095521ad01ef1' into haugesund 2022-05-30 16:20:35 +02:00
Maria Matejka
ba35b0f818 Merge commit '0e1e632f70b74cf111f08175ab3634db2f962579' into haugesund 2022-05-30 15:43:45 +02:00
Maria Matejka
54344f15f8 Merge commit '0d0f6554a5c233bf2bf830ae319191c4b1808d49' into haugesund 2022-05-30 15:43:13 +02:00
Maria Matejka
3752654852 Merge commit '80272d4b64a38ee6f04a1c4e8566cac3a2293176' into haugesund 2022-05-30 15:39:32 +02:00
Maria Matejka
032201378f Merge commit 'cd9550b24487ac7327b0234fd825f4214fdf7b16' into haugesund 2022-05-30 15:38:24 +02:00
Maria Matejka
45af19dd99 Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund 2022-05-30 15:36:54 +02:00
Maria Matejka
d7b077f5d6 Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund 2022-05-30 15:31:19 +02:00