aboutsummaryrefslogtreecommitdiffstats
path: root/filter
Commit message (Collapse)AuthorAgeFilesLines
* ASPA: checks done in filters; no autoreload yetMaria Matejka2024-03-254-1/+19
|
* Filter: Add route attribute gw_mpls_stackOndrej Zajicek2024-03-053-1/+59
| | | | | | | | | Add route attribute gw_mpls_stack to make MPLS stack of route nexthop accessible from filters. Its type is T_CLIST, which is really not correct (as it is a list, while T_CLIST is a set). Therefore, we keep this attribute *undocumented* and it will be *changed* without further notice. Based on a patch from Trisha Biswas <tbiswas@fastly.com>, thanks!
* Filter: Add support for string route attributeOndrej Zajicek2024-02-143-1/+13
|
* Filter: Tests for net_addrKaterina Kubecova2024-01-221-39/+138
| | | | Minor changes by committer.
* BGP: Improve custom BGP attributesOndrej Zajicek2023-10-051-1/+10
| | | | | | | - Implement EA_GET for custom BGP attributes - Forbid EA_SET on existing opaque attributes - Forbid redefining existing attributes - Document possible compatibility problems
* Filter: Fix scope handling in for loopsOndrej Zajicek2023-10-052-1/+61
| | | | | Changes in scope implementation broke scope handling in for loops. The term in for loops is supposed to be parsed in the parent scope.
* Filter: explicitly forbidden for-loop with pre-defined variableMaria Matejka2023-10-041-1/+1
|
* L3VPN: BGP/MPLS VPNs using MPLS backboneOndrej Zajicek2023-10-041-1/+6
| | | | | | | | | The L3VPN protocol implements RFC 4364 BGP/MPLS VPNs using MPLS backbone. It works similarly to pipe. It connects IP table (one per VRF) with (global) VPN table. Routes passed from VPN table to IP table are stripped of RD and filtered by import targets, routes passed in the other direction are extended with RD, MPLS labels and export targets in extended communities. A separate MPLS channel is used to announce MPLS routes for the labels.
* MPLS subsystemOndrej Zajicek2023-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The MPLS subsystem manages MPLS labels and handles their allocation to MPLS-aware routing protocols. These labels are then attached to IP or VPN routes representing label switched paths -- LSPs. There was already a preliminary MPLS support consisting of MPLS label net_addr, MPLS routing tables with static MPLS routes, remote labels in next hops, and kernel protocol support. This patch adds the MPLS domain as a basic structure representing local label space with dynamic label allocator and configurable label ranges. To represent LSPs, allocated local labels can be attached as route attributes to IP or VPN routes with local labels as attributes. There are several steps for handling LSP routes in routing protocols -- deciding to which forwarding equivalence class (FEC) the LSP route belongs, allocating labels for new FECs, announcing MPLS routes for new FECs, attaching labels to LSP routes. The FEC map structure implements basic code for managing FECs in routing protocols, therefore existing protocols can be made MPLS-aware by adding FEC map and delegating most work related to local label management to it.
* Basic route aggregationIgor Putovny2023-09-266-30/+139
| | | | | | | | | | | | | | | | | | Add a new protocol offering route aggregation. User can specify list of route attributes in the configuration file and run route aggregation on the export side of the pipe protocol. Routes are sorted and for every group of equivalent routes new route is created and exported to the routing table. It is also possible to specify filter which will run for every route before aggregation. Furthermore, it will be possible to set attributes of new routes according to attributes of the aggregated routes. This is a work in progress. Original work by Igor Putovny, subsequent cleanups and finalization by Maria Matejka.
* Simple testing of reconfiguration to a slightly different oneMaria Matejka2023-09-242-3/+8
|
* BGP: Setting and unsetting unknown attributeskaterina.kubecova2023-09-203-1/+17
| | | | | | | All these must be declared as bytestring. Allows operators to delete unwanted attributes breaking the Internet: https://blog.benjojo.co.uk/post/bgp-path-attributes-grave-error-handling
* Attributes declared in config can be bytestringskaterina.kubecova2023-09-202-4/+4
|
* Filter: Function unset() accepts attributes declared in configkaterina.kubecova2023-09-201-0/+9
|
* Structures bytestring and adata merged into adata.katerina.kubecova2023-09-203-4/+4
|
* Filter: Use common initializer for undefined variables and eattrs.Ondrej Zajicek2023-09-133-51/+28
| | | | | | Undefined paths and clists should use typed f_val with empty adata instead of just void f_val. Use common initializer to handle both variables and eattrs.
* Filter: Minor updates to methodsOndrej Zajicek2023-09-123-19/+11
| | | | | | | Remove warning when function-like syntax is used for calling add/remove/... methods. Fix argument offset in error messages for function-like syntax.
* Filter: Split clist add/delete operations to multiple methodsOndrej Zajicek2023-09-122-28/+85
|
* Filter: Implement constant promotion for multiple dispatch methodsOndrej Zajicek2023-09-123-10/+25
|
* Filter: Print proper error response in multiple method dispatchOndrej Zajicek2023-09-123-7/+82
| | | | | When no matching method is found, print an error response containing position and type of infringing argument and a set of expected types.
* Filter: Move argument list reversal from function_call to var_listOndrej Zajicek2023-09-121-18/+25
| | | | | | | List of arguments for function calls is constructed in reverse and then reverted. This was done in function_call grammar rule. Do the reverse directly in var_list grammar rule. This fixes reverse order of arguments in method calls.
* Filter: Better syntax for function return typesOndrej Zajicek2023-09-123-30/+28
| | | | The C-style syntax does not really fit into rest of our syntax.
* Filter: Implement multiple dispatch for methodsOndrej Zajicek2023-09-126-114/+204
| | | | | | | | | | | | | | | - Extend method descriptors with type signature - Daisy chain method descriptors for the same symbol - Dispatch methods for same symbol based on type signature - Split add/delete/filter operations to multiple methods - Replace ad-hoc dispatch of old-style syntax with scope-based dispatch - Also change method->arg_num to count initial arg It still needs some improvements, like better handling of untyped expressions and better error reporting when no dispatch can be done. The multiple dispatch could also be extended to dispatch regular function-like expressions in a uniform way.
* Filter: Make f_method_call_*() usage symmetricOndrej Zajicek2023-09-121-4/+2
|
* Filter: Convert more methods to use METHOD_R()Ondrej Zajicek2023-09-121-61/+23
|
* Filter: Remove number of args from METHOD_R()Ondrej Zajicek2023-09-122-19/+19
| | | | | Macro METHOD_R() is used for simplest methods, there is no place to define argument types, so let's force it to be 0.
* Filter: Print instructions take only one value (simplification)Maria Matejka2023-09-124-31/+37
|
* Filter: Shortened method declarationsMaria Matejka2023-09-122-107/+51
|
* Filter: The for loop uses the method system for type dispatchMaria Matejka2023-09-126-72/+85
|
* Removing unused terminals from filter configMaria Matejka2023-09-121-4/+0
|
* Filter: Methods reworkMaria Matejka2023-09-126-238/+756
| | | | | | | | | | | | | | | | | | | | | Methods can now be called as x.m(y), as long as x can have its type inferred in config time. If used as a command, it modifies the object, if used as a value, it keeps the original object intact. Also functions add(x,y), delete(x,y), filter(x,y) and prepend(x,y) now spit a warning and are considered deprecated. It's also possible to call a method on a constant, see filter/test.conf for examples like bgp_path = +empty+.prepend(1). Inside instruction definitions (filter/f-inst.c), a METHOD_CONSTRUCTOR() call is added, which registers the instruction as a method for the type of its first argument. Each type has its own method symbol table and filter parser switches between them based on the inferred type of the object calling the method. Also FI_CLIST_(ADD|DELETE|FILTER) instructions have been split to allow for this method dispatch. With type inference, it's now possible.
* Uninitialized filter variables of path/[el]?clist types are now explicitly emptyMaria Matejka2023-09-121-27/+15
|
* Filter: functions can and should have typed return valuesMaria Matejka2023-09-124-29/+59
|
* Filter/Conf: Method names have their own keyword hashMaria Matejka2023-09-121-8/+21
| | | | | To allow for future dynamic method definition, parsing method names is done via a dedicated keyword hash/scope.
* Conf: Symbol manipulation gets its context explicitlyMaria Matejka2023-09-121-19/+19
|
* Filter: any lvalue can get its methods calledMaria Matejka2023-09-122-21/+51
|
* Filter: split out dot-notation methods to separate targetsMaria Matejka2023-09-121-36/+63
| | | | | This is just a preparationary refactoring to allow type-based method tables.
* Conf: Symbol hashes for all scopesMaria Matejka2023-09-121-9/+9
| | | | | | | | | This is a backport cherry-pick of commits 165156beeb2926472bbceca3c103aacc3f81a8cc cce974e8ea992d0e6d2f649eca7880b436d91d71 from the v3.0 branch as we need symbol hashes directly inside their scopes for more general usage than before.
* Dropping empty-type const f_vals, they were copied anywayMaria Matejka2023-09-123-30/+21
|
* Conf: Allow keywords to be redefined by user symbolsOndrej Zajicek2023-08-251-1/+2
| | | | | | | | | | | | | | Most syntactic constructs in BIRD configuration (e.g. protocol options) are defined as keywords, which are distinct from symbols (user-defined names for protocols, variables, ...). That may cause backwards compatibility issue when a new feature is added, as it may collide with existing user names. We can allow keywords to be shadowed by symbols in almost all cases to avoid this issue. This replaces the previous mechanism, where shadowable symbols have to be explictly added to kw_syms.
* Filter: Add separate instruction for uninitialized variable declarationOndrej Zajicek2023-08-253-10/+22
| | | | | | | The previous approach (use VOID constant for variable initialization) failed due to dynamic type check failure. Thanks to Alexander Zubkov <green@qrator.net> for the bugreport.
* Filter: Use more generic approach for intra-config expressionsAlexander Zubkov2023-08-243-22/+16
| | | | | Replace f_eval_int() function with a type-generic variant: cf_eval(). Implement similar fuction: cf_eval_int() via inline call to cf_eval().
* Filter: Add bytestring typeAlexander Zubkov2023-08-246-9/+75
| | | | | | | | | - Rename BYTESTRING lexem to BYTETEXT, not to collide with 'bytestring' type name - Add bytestring type with id T_BYTESTRING (0x2c) - Add from_hex() filter function to create bytestring from hex string - Add filter test cases for bytestring type Minor changes by committer.
* Merge tag 'v2.13.1'Maria Matejka2023-06-223-6/+26
|\
| * Filter: Fixed segfault when a case option had an empty blockMaria Matejka2023-06-223-6/+26
| | | | | | | | Thanks to Kobayashi_Bairuo <noc@tohunet.com> for reporting.
* | Nest: Add tests and benchmark for FIBOndrej Zajicek2023-05-161-28/+5
|/ | | | | | Basic fib_get() / fib_find() test for random prefixes, FIB_WALK() test, and benchmark for fib_find(). Also generalize and reuse some code from trie tests.
* Filter: Disable some trie formatting testsOndrej Zajicek2023-04-211-6/+6
| | | | | Trie formatting works slightly different with 4-way tries than with 16-way ones, so these tests generated false error. Block them for now.
* Config: Dropping filter instruction trees after linearizationMaria Matejka2023-02-222-3/+1
|
* Added test case for switch bug fixed in e20bef69ccc4a85ef62359ee539c9db2dbe09127Maria Matejka2023-01-221-0/+12
|
* Filter: Allow setting the 'onlink' route attribute in filtersRadu Carpa2023-01-173-3/+15
| | | | | | | | | 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;