summaryrefslogtreecommitdiff
path: root/filter
AgeCommit message (Collapse)Author
2022-05-04Fixed spurious undef of route attributesAlexander Zubkov
2022-04-06Unsetting route attributes without messing with type systemMaria Matejka
2022-04-06Eattr flags (originated and fresh) get their own struct fieldsMaria Matejka
2022-03-09Merge commit 'e42eedb9' into haugesundMaria Matejka
2022-03-09Merge commit '5cff1d5f' into haugesundMaria Matejka
Conflicts: proto/bgp/attrs.c proto/pipe/pipe.c
2022-03-02Replaced custom linpools in tests for the common tmp_linpoolMaria Matejka
2022-03-02Merge commit '2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9' into haugesundMaria Matejka
2022-02-06Merge branch 'oz-trie-table'Ondrej Zajicek (work)
2022-02-06Trie: Fix trie formatOndrej Zajicek (work)
After switching to 16-way tries, trie format ignored unaligned / internal prefixes and only reported the primary prefix of a trie node. Fix trie format by showing internal prefixes based on the 'local' bitmask of a node. Also do basic (intra-node) reconstruction of prefix patterns by finding common subtrees in 'local' bitmask. In future, we could improve that by doing inter-node reconstruction, so prefixes entered as one pattern for a subtree (e.g. 192.168.0.0/18+) would be reported as such, like with aligned prefixes.
2022-02-06Trie: Add prefix counterOndrej Zajicek (work)
Add counter of prefixes stored in trie. Works only for 'restricted' tries composed of explicit prefixes (pxlen == l == h), like ones used in rtables.
2022-01-05Conf: Fix parsing full-length IPv6 addressesOndrej Zajicek (work)
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
2021-12-28Filter: Add operators to find minimum and maximum element of setsAlexander Zubkov
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>
2021-12-28Filter: Add operators to pick community componentsAlexander Zubkov
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>
2021-12-02Trie: Clarify handling of less-common net typesOndrej Zajicek (work)
For convenience, Trie functions generally accept as input values not only NET_IPx types of nets, but also NET_VPNx and NET_ROAx types. But returned values are always NET_IPx types.
2021-11-26Trie: Implement longest-prefix-match queries and walksOndrej Zajicek (work)
The prefix trie now supports longest-prefix-match query by function trie_match_longest_ipX() and it can be extended to iteration over all covering prefixes for a given prefix (from longest to shortest) using TRIE_WALK_TO_ROOT_IPx() macro.
2021-11-19Trie: Implement trie walking codeOndrej Zajicek (work)
Trie walking allows enumeration of prefixes in a trie in the usual lexicographic order. Optionally, trie enumeration can be restricted to a chosen subnet (and its descendants).
2021-11-13Trie: Simplify network matching codeOndrej Zajicek (work)
Introduce ipX_prefix_equal() and use it to simplify network matching code.
2021-10-13Route: moved rte_src pointer from rta to rteMaria Matejka
It is an auxiliary key in the routing table, not a route attribute.
2021-10-13Dropping the RTS_DUMMY temporary route storage.Maria Matejka
Kernel route sync is done by other ways now and this code is not used currently.
2021-10-13Preference moved to RTA and set explicitly in protocolsMaria Matejka
2021-09-25Filter: Add prefix trie benchmarksOndrej Zajicek (work)
Add trie tests intended as benchmarks that use external datasets instead of generated prefixes. As datasets are not included, they are commented out by default.
2021-09-25Filter: Improve prefix trie testsOndrej Zajicek (work)
Add tests explicitly matching insides and outsides of trie and update tests to do testing of both IPv4 and IPv6 tries.
2021-09-25Filter: Update trie documentationOndrej Zajicek (work)
2021-09-25Filter: Fix trie testOndrej Zajicek (work)
Generated prefixes must be valid.
2021-09-25Filter: Faster prefix setsOndrej Zajicek (work)
Use 16-way (4bit) branching in prefix trie instead of basic binary branching. The change makes IPv4 prefix sets almost 3x faster, but with more memory consumption and much more complicated algorithm. Together with a previous filter change, it makes IPv4 prefix sets about ~4.3x faster and slightly smaller (on my test data).
2021-09-10Reducing filter stack size to allow for lesser thread stack sizeMaria Matejka
2021-09-10Filter: Additional consistency checksMaria Matejka
2021-05-18Flowspec: Label field should use numeric operator and not bitmask operatorOndrej Zajicek (work)
2021-05-18Flowspec: Do not use comma for bitmask operatorsOndrej Zajicek (work)
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.
2021-05-17Filter: Add MPLS label route attributeTrisha Biswas
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.
2021-03-15Filter: Update 'gw' to handle IPv6 link-local addressesOndrej Zajicek (work)
When a link-local address is set, use the existing iface for scope. Thanks to Marcel Krüger for the bugreport.
2021-02-07Filter: Recursive filter iteration codeOndrej Zajicek (work)
Add macros for recursive filter iteration that allows to examine all instructions reachable from a filter.
2020-12-28Filter: Fix return on top-levelOndrej Zajicek (work)
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.
2020-12-02Filter: Add 'weight' route attributeOndrej Zajicek (work)
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.
2020-11-24Minor cleanups with cfg_allocz()Ondrej Zajicek (work)
Also fixes some more failed asserts due to add_tail().
2020-06-28Filter: Improve handling of sets in BGP path masksKazuki Yamaguchi
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.
2020-06-28Filter: Fix comparison of BGP path maskKazuki Yamaguchi
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.
2020-05-18Nest: Implement BGP path mask loop operatorOndrej Zajicek (work)
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.
2020-05-02Filter: Remove quitbird commandOndrej Zajicek (work)
No need for this debug filter command and it can be abused from CLI.
2020-05-01Filter: Don't alloc varargs array if its length would be zeroMaria Matejka
2020-05-01Filter: Removed forgotten dead codeMaria Matejka
2020-04-28Filter: fixed omitted overflow check in EC constructorMaria Matejka
2020-04-09Configuration strings are constant.Maria Matejka
This is merely a const propagation. There was no problem in there.
2020-03-26Filter: Remove mixed address tests and fix formattingOndrej Zajicek (work)
2020-03-26Filter: Optimize IPv4 prefix setsOndrej Zajicek (work)
Use separate IPv4 and IPv6 implementation of prefix sets. Just this change makes IPv4 prefix sets 60% smaller and 50% faster.
2020-01-07Filter: Fix typecheck for AND/OR.Ondrej Zajicek (work)
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.
2019-12-17Test: Improve filter_testOndrej Zajicek (work)
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.
2019-12-12Filter: fix filter comparison testMaria Matejka
2019-12-10Filter: Fix function comparisonOndrej Zajicek (work)
Check the SYM_FLAG_SAME in new symbols. The old code checked that in old symbols (f2).
2019-12-09Filter: Add support for src/dst accessors for Flowspec and SADROndrej Zajicek (work)