summaryrefslogtreecommitdiff
path: root/filter
AgeCommit message (Collapse)Author
2023-01-24Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-nextMaria Matejka
2023-01-23Merge commit '928a1cb034e6f9e8edcdd1dc07264cd703e00827' into thread-nextMaria Matejka
2023-01-23Merge commit '7fb23041a52d01754c53ba963e2282e524813364' into thread-nextMaria Matejka
2023-01-23Merge commit 'b28431e557c4f63923476094a919a0630001275e' into thread-nextMaria Matejka
2023-01-23Merge commit 'd3f50ede127df338f575e188566035b2a46cf6c6' into thread-nextMaria Matejka
2023-01-22Added test case for switch bug fixed in e20bef69ccc4a85ef62359ee539c9db2dbe09127Maria Matejka
2023-01-20Fixed various build problems on FreeBSD and/or CLangMaria Matejka
2023-01-19Removed config reparsing from unrelated testsMaria Matejka
2023-01-17Filter: Allow setting the 'onlink' route attribute in filtersRadu Carpa
Add static route attribute to set onlink flag for route next hop. Can be used to build a dynamically routed IP-in-IP overlay network. Usage: ifname = "tunl0"; onlink = true; gw = bgp_next_hop;
2023-01-13Minor cleanupsOndrej Zajicek
2023-01-07Filter: Change linearization of branches in switch instructionOndrej Zajicek
Most branching instructions (FI_CONDITION, FI_AND, FI_OR) linearize its branches in a recursive way, while FI_SWITCH branches are linearized from parser even before the switch instruction is allocated. Change linearization of FI_SWITCH branches to make it similar to other branching instructions. This also fixes an issue with constant switch evaluation, where linearized branch is mistaken for non-linearized during switch construction. Thanks to Jiten Kumar Pathy for the bugreport.
2023-01-02Add compile-time option to enable 4-way tries instead of 16-way onesOndrej Zajicek
In some cases 16-way tries are too memory-heavy, while 4-way are almost as efficient as the original 2-way ones.
2022-11-07Merge commit '37b64441' into thread-nextMaria Matejka
2022-11-07Merge commit '8478de88' into thread-nextMaria Matejka
2022-11-01Moved config-related allocations to config_pool and showing its size in ↵Maria Matejka
memory usage
2022-10-18Filter: Fix handling of variables in anonymous filtersOndrej Zajicek
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-03Filter: Add some minor functions for f_tree and ECOndrej Zajicek
Add some supportive functions for f_tree and EC. These functions are used by L3VPN code.
2022-09-21Caching eattrs in filters is not needed anymore.Maria Matejka
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-21Flushing tmp_linpool in tree test and in static protocolMaria Matejka
2022-09-21Trie test uses direct tmp_allocz() instead of lp_allocz(tmp_linpool)Maria Matejka
2022-09-19Switched off forking for filter test.Maria Matejka
You don't want to fork with threads running.
2022-09-16Revert "Reducing filter stack size to allow for lesser thread stack size"Maria Matejka
This reverts commit 2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9.
2022-09-08Table access is now locked.Maria Matejka
2022-08-02Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-nextMaria Matejka
2022-07-18Merge commit '94eb0858' into thread-nextMaria Matejka
2022-07-13Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-nextMaria Matejka
2022-07-11Merge remote-tracking branch 'origin/master' into backportMaria Matejka
2022-06-27Filter: Implement for loopsOndrej Zajicek (work)
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-27Filter: Implement mixed declarations of local variablesOndrej Zajicek (work)
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-27Filter: Improve handling of stack frames in filter bytecodeOndrej Zajicek (work)
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-27Filter: Simplify handling of command sequencesOndrej Zajicek (work)
Command sequences in curly braces used a separate nonterminal in grammar. Handle them as a regular command.
2022-06-27Filter: Fix bug in variable shadowingOndrej Zajicek (work)
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-27Filter: Implement direct recursionOndrej Zajicek (work)
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-27Filter: Apply constant promotion for FI_EQ / FI_NEQOndrej Zajicek (work)
Equality comparison is defined on all values, even of different types, but we still want to do constant promotion if possible.
2022-06-27Filter: Add literal for empty setAlexander Zubkov
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-27Nest: Cleanups in as_path_filter()Ondrej Zajicek (work)
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-27Filter: Ensure that all expressions declared return typeOndrej Zajicek (work)
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-27Filter: Improve description of type systemOndrej Zajicek (work)
2022-06-27Filter: Implement type checks for function callsOndrej Zajicek (work)
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-27Filter: Clean up function call instructionOndrej Zajicek (work)
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-27Fixed displaying BGP and RIP attributes after recent reworksMaria Matejka
2022-06-27Fixed minor bugs in handling some route attributesMaria Matejka
2022-06-26Fixed forgotten preference handling in filtersMaria Matejka
2022-06-08Merge commit '938742decc6e1d6d3a0375dd012b75172e747bbc' into haugesundMaria Matejka
2022-06-08Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesundMaria Matejka
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-05-30Merge commit 'f15f2fcee7eeb5a100bd204a0e67018e25953420' into haugesundMaria Matejka
2022-05-30Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesundMaria Matejka
2022-05-30Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesundMaria Matejka
2022-05-30Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesundMaria Matejka
2022-05-30Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesundMaria Matejka