aboutsummaryrefslogtreecommitdiffstats
path: root/filter
Commit message (Collapse)AuthorAgeFilesLines
* Conf: Fix parsing full-length IPv6 addressesOndrej Zajicek (work)2022-01-051-0/+20
| | | | | | | | | | Lexer expression for bytestring was too loose, accepting also full-length IPv6 addresses. It should be restricted such that colon is used between every byte or never. Fix the regex and also add some test cases for it. Thanks to Alexander Zubkov for the bugreport
* Filter: Add operators to find minimum and maximum element of setsAlexander Zubkov2021-12-285-0/+102
| | | | | | | | | | | Add operators .min and .max to find minumum or maximum element in sets of types: clist, eclist, lclist. Example usage: bgp_community.min bgp_ext_community.max filter(bgp_large_community, [(as1, as2, *)]).min Signed-off-by: Alexander Zubkov <green@qrator.net>
* Filter: Add operators to pick community componentsAlexander Zubkov2021-12-283-8/+53
| | | | | | | | | | | | | | | Add operators that can be used to pick components from pair (standard community) or lc (large community) types. For example: (10, 20).asn --> 10 (10, 20).data --> 20 (10, 20, 30).asn --> 10 (10, 20, 30).data1 --> 20 (10, 20, 30).data2 --> 30 Signed-off-by: Alexander Zubkov <green@qrator.net>
* Flowspec: Label field should use numeric operator and not bitmask operatorOndrej Zajicek (work)2021-05-181-0/+1
|
* Flowspec: Do not use comma for bitmask operatorsOndrej Zajicek (work)2021-05-181-1/+1
| | | | | | | | | For numeric operators, comma is used for disjunction in expressions like "10, 20, 30..40". But for bitmask operators, comma is used for conjunction in a way that does not really make much sense. Use always explicit logical operators (&& and ||) to connect bitmask operators. Thanks to Matt Corallo for the bugreport.
* Filter: Add MPLS label route attributeTrisha Biswas2021-05-173-1/+22
| | | | | | | Add support to set or read outgoing MPLS labels using filters. Currently this supports the addition of one label per route for the first next hop. Minor changes by committer.
* Filter: Update 'gw' to handle IPv6 link-local addressesOndrej Zajicek (work)2021-03-151-1/+2
| | | | | | When a link-local address is set, use the existing iface for scope. Thanks to Marcel Krüger for the bugreport.
* Filter: Recursive filter iteration codeOndrej Zajicek (work)2021-02-075-0/+106
| | | | | Add macros for recursive filter iteration that allows to examine all instructions reachable from a filter.
* Filter: Fix return on top-levelOndrej Zajicek (work)2020-12-281-6/+5
| | | | | | | Broken detection of top-level case caused crash when return was called from top-of-stack position. It should behave as reject/accept. Thanks to Damian Zaremba for the bugreport.
* Filter: Add 'weight' route attributeOndrej Zajicek (work)2020-12-023-1/+18
| | | | | | | Add 'weight' route attribute that allows to get and set ECMP weight of nexthops. Similar to 'gw' attribute, it is limited to the first nexthop, but it is useful for handling BGP multipath, where an ECMP route is merged from multiple regular routes.
* Minor cleanups with cfg_allocz()Ondrej Zajicek (work)2020-11-241-6/+1
| | | | Also fixes some more failed asserts due to add_tail().
* Filter: Improve handling of sets in BGP path masksKazuki Yamaguchi2020-06-281-0/+9
| | | | | | | | | Compare the content of PM_ASN_SET in path masks. A reconfiguration was not properly triggering a reload of affected protocols when the members of a set in a path mask change. Also, update the printing code to so that it can display sets in a path mask.
* Filter: Fix comparison of BGP path maskKazuki Yamaguchi2020-06-281-0/+1
| | | | | | Add a missing return statement. Path masks with the same length were all considered the same. Comparing two with different length would cause out-of-bounds memory access.
* Nest: Implement BGP path mask loop operatorOndrej Zajicek (work)2020-05-184-2/+32
| | | | | | | Implement regex-like '+' operator in BGP path masks to match previous path mask item multiple times. This is useful as ASNs may appear multiple times in paths due to path prepending for traffic engineering purposes.
* Filter: Remove quitbird commandOndrej Zajicek (work)2020-05-024-8/+2
| | | | No need for this debug filter command and it can be abused from CLI.
* Filter: Don't alloc varargs array if its length would be zeroMaria Matejka2020-05-011-1/+1
|
* Filter: Removed forgotten dead codeMaria Matejka2020-05-011-153/+0
|
* Filter: fixed omitted overflow check in EC constructorMaria Matejka2020-04-281-16/+15
|
* Configuration strings are constant.Maria Matejka2020-04-091-1/+1
| | | | This is merely a const propagation. There was no problem in there.
* Filter: Remove mixed address tests and fix formattingOndrej Zajicek (work)2020-03-262-37/+9
|
* Filter: Optimize IPv4 prefix setsOndrej Zajicek (work)2020-03-264-88/+243
| | | | | Use separate IPv4 and IPv6 implementation of prefix sets. Just this change makes IPv4 prefix sets 60% smaller and 50% faster.
* Filter: Fix typecheck for AND/OR.Ondrej Zajicek (work)2020-01-072-3/+8
| | | | | | | Do not apply dynamic type check for second argument of AND/OR, as it is not evaluated immediately like regular argument would be. Thanks to Mikael for the bugreport.
* Test: Improve filter_testOndrej Zajicek (work)2019-12-172-31/+21
| | | | | | Initial parsing of test.conf must be done directly in filter_test main, while reconfiguration is handled as a regular test. Also fix several minor issues in test code.
* Filter: fix filter comparison testMaria Matejka2019-12-121-13/+13
|
* Filter: Fix function comparisonOndrej Zajicek (work)2019-12-101-1/+1
| | | | | Check the SYM_FLAG_SAME in new symbols. The old code checked that in old symbols (f2).
* Filter: Add support for src/dst accessors for Flowspec and SADROndrej Zajicek (work)2019-12-094-8/+69
|
* Filter: Add type info for more instructionsOndrej Zajicek (work)2019-11-051-2/+12
|
* Filter: Improve typecheck error messagesOndrej Zajicek (work)2019-11-055-9/+71
|
* Filter: Better constant promotionOndrej Zajicek (work)2019-11-051-1/+20
| | | | | | We use constant promotion from IPv4 to Router-ID values, as they have same literals. Instead of ad-hoc code in filter instructions, add constant promotion code to parse-time typecheck code.
* Filter: Improved parse-time typechecksOndrej Zajicek (work)2019-11-052-56/+12
|
* Filter: Parse-time typechecksOndrej Zajicek2019-11-053-38/+63
| | | | | | Most expressions can be type-validated in parse time. It is not strong enough to eliminate runtime checks, but at least one gets errors immediately during reconfigure.
* Support for address family constantsOndrej Zajicek (work)2019-11-031-0/+1
| | | | We already had them defined on BGP level, but they are more general.
* Filter: Fix eval commandOndrej Zajicek (work)2019-09-241-1/+1
|
* Filters: Function body comparison result now used.Maria Matejka2019-09-231-0/+5
| | | | | | | Function bodies were compared in post-parse time, yet the result was not used and the functions were incorrectly considered the same as before. Now the result is used to reload affected protocols.
* Filter: Fix crash with 'where' filters and function callsOndrej Zajicek (work)2019-09-101-25/+4
| | | | | The old 'where' code computed size value incorrectly, which leads to invalid instruction lines and filter errors or crashes.
* Filter: Fixing empty block and never-executed-statement bugMaria Matejka2019-08-132-10/+26
|
* Filter: Allow to use set constants / expressions in path masksOndrej Zajicek (work)2019-08-062-0/+17
| | | | | Allow to not only use set literals in path masks, but also existing set constants or set expressions.
* Filter: Allow to use sets in path masksOndrej Zajicek (work)2019-08-062-0/+5
|
* Conf: Fixed symbol redefinitionMaria Matejka2019-07-301-6/+6
|
* Filter: further split of print & die to FI_PRINT, FI_FLUSH and FI_DIEMaria Matejka2019-07-152-22/+23
|
* Filter: Simpler filter context allocationMaria Matejka2019-07-151-20/+19
|
* Filter: FID_MEMBER debug string is a C constant stringMaria Matejka2019-07-152-8/+8
|
* Filter: Converted FI_PRINT and FI_PATHMASK_CONSTRUCT to VARARGMaria Matejka2019-07-154-81/+63
|
* Filter: fixed excessive stack allocation in functions with args but no local ↵Maria Matejka2019-07-151-21/+21
| | | | vars
* Filter: lots of documentationMaria Matejka2019-07-153-49/+156
|
* Filter: Don't write out when re-evaluating filter for internal purposes.Maria Matejka2019-07-151-1/+1
|
* Filter: Don't fail badly when trying to access non-existent route in config timeMaria Matejka2019-07-152-4/+2
|
* Filter: Minor cleanupsOndrej Zajicek (work)2019-07-102-23/+33
|
* Merge branch 'mq-filter-stack' of gitlab.labs.nic.cz:labs/bird into ↵Maria Matejka2019-07-037-204/+396
|\ | | | | | | mq-filter-stack
| * Filter: CLI command to dump all the linearized filtersMaria Matejka2019-07-032-2/+42
| |